From 8768e822f7adfd92fa0facc2f8046240ea298cb6 Mon Sep 17 00:00:00 2001 From: Mamalizz Date: Fri, 3 Oct 2025 21:41:56 +0330 Subject: [PATCH] connected to new url param --- frontend/pages/profile/notifications.vue | 23 +++---- .../profile/purchases-and-orders/index.vue | 29 ++++----- frontend/pages/profile/tickets/index.vue | 36 ++++------- frontend/pages/resellers/[...slug].vue | 60 +++++-------------- 4 files changed, 43 insertions(+), 105 deletions(-) diff --git a/frontend/pages/profile/notifications.vue b/frontend/pages/profile/notifications.vue index 2c5d6b4..4e39860 100644 --- a/frontend/pages/profile/notifications.vue +++ b/frontend/pages/profile/notifications.vue @@ -14,16 +14,15 @@ definePageMeta({ import { usePushNotifications } from "~/composables/global/usePushNotifications"; import useSubscribeNotification from "~/composables/api/notifications/useSubscribeNotification"; -import useGetAllNotifications, { - type GetAllNotificationsRequest, -} from "~/composables/api/account/useGetAllNotifications"; +import useGetAllNotifications from "~/composables/api/account/useGetAllNotifications"; +import { useAppParams } from "~/composables/global/useAppParams"; // state -const params: GetAllNotificationsRequest = useUrlSearchParams("history"); - const subscribe = ref(false); +const { status, sort } = useAppParams(); + const sortFilters = ref([ { title: "اخبار", @@ -59,17 +58,9 @@ const { isPending: subscribeNotificationIsPending } = useSubscribeNotification() // computeds -const filters = computed(() => { - return { - sort: params.sort ?? "created_at", - status: params.status ?? "", - page: params.page ?? 1, - }; -}); - const hasNotifications = computed(() => data.value && data.value.count > 0); -const { data, isLoading: notificationsIsLoading } = useGetAllNotifications(filters); +const { data, isLoading: notificationsIsLoading } = useGetAllNotifications(); const notifications = computed(() => { return data.value?.results.flat(); @@ -136,7 +127,7 @@ watch( فیلتر بر اساس diff --git a/frontend/pages/profile/purchases-and-orders/index.vue b/frontend/pages/profile/purchases-and-orders/index.vue index 92757e3..f6eb539 100644 --- a/frontend/pages/profile/purchases-and-orders/index.vue +++ b/frontend/pages/profile/purchases-and-orders/index.vue @@ -1,5 +1,6 @@ @@ -123,7 +114,7 @@ const clearFilters = () => { > ترتیب بر اساس diff --git a/frontend/pages/profile/tickets/index.vue b/frontend/pages/profile/tickets/index.vue index 2a653af..4175093 100644 --- a/frontend/pages/profile/tickets/index.vue +++ b/frontend/pages/profile/tickets/index.vue @@ -1,7 +1,8 @@ @@ -110,7 +96,7 @@ const clearFilters = () => { > ترتیب بر اساس diff --git a/frontend/pages/resellers/[...slug].vue b/frontend/pages/resellers/[...slug].vue index 2c687be..62d7f6f 100644 --- a/frontend/pages/resellers/[...slug].vue +++ b/frontend/pages/resellers/[...slug].vue @@ -1,76 +1,46 @@