From e69c76433c630ee4c75b9f210bf0eabd9dc9728b Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Sun, 2 Feb 2025 23:03:07 +0330 Subject: [PATCH 01/16] updated address type --- frontend/types/global.d.ts | 53 ++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/frontend/types/global.d.ts b/frontend/types/global.d.ts index e28b8ce..0332504 100644 --- a/frontend/types/global.d.ts +++ b/frontend/types/global.d.ts @@ -20,7 +20,7 @@ declare global { email: string; profile_photo: string; phone: string; - } + }; type Product = { id: number; @@ -28,10 +28,10 @@ declare global { name: string; description: string; currency: string; - "video": string | null, - "image1": string, - "image2": string, - "image3": string, + video: string | null; + image1: string; + image2: string; + image3: string; rating: number; view: number; sell: number; @@ -44,40 +44,43 @@ declare global { }; type UserComment = { - "id": number, - "content": string, - "timestamp": string, - "show": boolean, - "product": number, - "user": number - } + id: number; + content: string; + timestamp: string; + show: boolean; + product: number; + user: number; + }; type Category = { id: number; name: string; slug: string; icon: string; - "product_count": string, - "subcategorys": SubCategory[] + product_count: string; + subcategorys: SubCategory[]; }; type SubCategory = { - "id": number, - "name": string, - "slug": string, - "icon": string, - "image": string, - "product_count": string, - "parent": string, - "show": boolean - } + id: number; + name: string; + slug: string; + icon: string; + image: string; + product_count: string; + parent: string; + show: boolean; + }; type Address = { - id: number; + id: number | undefined; province: string; city: string; postal_code: string; - full_address: string; + address: string; + phone: string; + name: string; + for_me: "خیر" | "بله"; }; type DeliveryMethod = { From 128c31819a07af58b4957aa460778f7ae7b93165 Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Sun, 2 Feb 2025 23:03:26 +0330 Subject: [PATCH 02/16] added check logged in middleware --- frontend/pages/cart/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/pages/cart/index.vue b/frontend/pages/cart/index.vue index 9f27aac..dc935b9 100644 --- a/frontend/pages/cart/index.vue +++ b/frontend/pages/cart/index.vue @@ -1,6 +1,7 @@ + + + + From 2599e501cb9ed5b454657a35d7ccb06ab379a3a7 Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Sun, 2 Feb 2025 23:05:33 +0330 Subject: [PATCH 12/16] fixed select state --- frontend/components/global/Select.vue | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/components/global/Select.vue b/frontend/components/global/Select.vue index f66f7a3..0b62161 100644 --- a/frontend/components/global/Select.vue +++ b/frontend/components/global/Select.vue @@ -13,7 +13,9 @@ type Emit = { // props -defineProps(); +const props = defineProps(); + +const { modelValue } = toRefs(props); // emit @@ -21,16 +23,12 @@ const emit = defineEmits(); // state -const selectedValue = ref(); +const selectedValue = computed({ + get: () => modelValue.value, + set: (value: string) => emit("update:modelValue", value), +}); // watch - -watch( - () => selectedValue.value, - (newValue) => { - emit("update:modelValue", newValue); - } -);