From c5280144de096c274f185fade287ccd63b954ceb Mon Sep 17 00:00:00 2001
From: "Adam T. Carpenter" <atc@53hor.net>
Date: Sun, 8 Nov 2020 21:26:34 -0500
Subject: fixed up product models and api calls, working on new product form

---
 iridescence/src/components/admin/NewProduct.vue | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

(limited to 'iridescence/src/components/admin/NewProduct.vue')

diff --git a/iridescence/src/components/admin/NewProduct.vue b/iridescence/src/components/admin/NewProduct.vue
index 8c45f0b..511ae9c 100644
--- a/iridescence/src/components/admin/NewProduct.vue
+++ b/iridescence/src/components/admin/NewProduct.vue
@@ -17,7 +17,9 @@
             <button class="delete" @click="toggleModal"></button>
           </header>
           <section class="modal-card-body">
-            <ProductEditCard v-bind:current-product="product"></ProductEditCard>
+            <ProductEditCard
+              v-bind:current-product="newProduct"
+            ></ProductEditCard>
           </section>
           <footer class="modal-card-foot"></footer>
         </div>
@@ -27,26 +29,18 @@
 </template>
 
 <script>
-import ProductEditCard from "./ProductEditCard.vue";
+import Product from "../../models/product";
+import ProductEditCard from "./ProductEditCard";
 
 export default {
-  name: "AddNewProduct",
+  name: "NewProduct",
   components: {
     ProductEditCard
   },
   data: function() {
     return {
       modalEnabled: false,
-      product: {
-        id: 0,
-        name: "",
-        quantity: 0,
-        cents: 0,
-        imgPath: "",
-        description: "",
-        featured: false,
-        categories: []
-      },
+      newProduct: new Product(),
       addAnother: false
     };
   },
-- 
cgit v1.2.3

