From c7d03346ee42d7b464faccbad77703e0cdc5ae2c Mon Sep 17 00:00:00 2001 From: lmartz Date: Tue, 24 Sep 2024 12:21:30 -0300 Subject: [PATCH] Add Product --- src/App.vue | 33 ++++++++++++----------- src/components/app/Intro.vue | 2 +- src/components/productos/ProductModal.vue | 7 +++-- src/views/HomeView.vue | 12 ++++++++- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/App.vue b/src/App.vue index 94bb4aa..2208301 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,6 +46,23 @@ body { color: #2c3e50; } +#title-bar { + -webkit-app-region: drag; + height: 20px; + background: var(--primary); + color: white; + display: flex; + align-items: center; + padding: 0 10px; +} + +#notification-container { + top: unset !important; + bottom: 2em !important; + margin-top: 6em; + right: 4% !important; +} + nav { padding: 30px; @@ -83,16 +100,6 @@ label { position: relative; } -#title-bar { - -webkit-app-region: drag; - height: 20px; - background: var(--primary); - color: white; - display: flex; - align-items: center; - padding: 0 10px; -} - .select-wrapper::after { content: ">" !important; } @@ -117,12 +124,6 @@ label { animation: slideOut var(--duration) forwards; } -#notification-container { - top: unset !important; - bottom: 2em !important; - margin-top: 6em; - right: 4% !important; -} [selectedNav="true"] { background: white; diff --git a/src/components/app/Intro.vue b/src/components/app/Intro.vue index e889b0d..8844307 100644 --- a/src/components/app/Intro.vue +++ b/src/components/app/Intro.vue @@ -39,7 +39,7 @@ onMounted(() => {
-

Hacemos tus sueƱos
realidad

+

La fabrica de aplicaciones
Web

diff --git a/src/components/productos/ProductModal.vue b/src/components/productos/ProductModal.vue index 7941b65..f3aaa89 100644 --- a/src/components/productos/ProductModal.vue +++ b/src/components/productos/ProductModal.vue @@ -1,21 +1,24 @@ @@ -15,6 +15,7 @@ import {useUi} from "@/pinia/ui"; import {useUserStore} from "@/pinia/user"; import ProductModal from "@/components/productos/ProductModal.vue"; import {useProductStore} from "@/pinia/products"; +import {DBService, post} from "@/services/apiReq"; const ui = useUi(); const productStore = useProductStore() @@ -42,4 +43,13 @@ const productos = ref([ function handleClick() { ui.setCurrentMenu(null) } + +async function saveProduct(product) { + let response = await post('/insert', { + table: 'productos', + data: product, + }, DBService); + productStore.product_modal = false; + await productStore.fetchProducts(); +}