From d28fe5b94a3f902e272008a80c72158f6ff9b8f5 Mon Sep 17 00:00:00 2001 From: Dmytro Svyrydenko Date: Sun, 22 Sep 2024 20:02:55 +0200 Subject: [PATCH] fix: Query keys invalidation --- .../components/mark-as-refund/refund-records-list.vue | 2 +- .../dialogs/manage-transaction/dialog-content.vue | 7 ------- src/components/dialogs/manage-transaction/record-list.vue | 2 +- src/pages/records/records.vue | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/dialogs/manage-transaction/components/mark-as-refund/refund-records-list.vue b/src/components/dialogs/manage-transaction/components/mark-as-refund/refund-records-list.vue index 514c53e..e9050ed 100644 --- a/src/components/dialogs/manage-transaction/components/mark-as-refund/refund-records-list.vue +++ b/src/components/dialogs/manage-transaction/components/mark-as-refund/refund-records-list.vue @@ -86,7 +86,7 @@ const { isFetched, } = useInfiniteQuery({ queryKey: [ - VUE_QUERY_CACHE_KEYS.recordsPageTransactionList, + ...VUE_QUERY_CACHE_KEYS.recordsPageTransactionList, props.transactionType, appliedFilters, ], diff --git a/src/components/dialogs/manage-transaction/dialog-content.vue b/src/components/dialogs/manage-transaction/dialog-content.vue index b558e94..6f87f9e 100644 --- a/src/components/dialogs/manage-transaction/dialog-content.vue +++ b/src/components/dialogs/manage-transaction/dialog-content.vue @@ -25,7 +25,6 @@ import { VERBOSE_PAYMENT_TYPES, OUT_OF_WALLET_ACCOUNT_MOCK, VUE_QUERY_TX_CHANGE_QUERY, - VUE_QUERY_CACHE_KEYS, } from "@/common/const"; import InputField from "@/components/fields/input-field.vue"; import SelectField from "@/components/fields/select-field.vue"; @@ -261,12 +260,6 @@ const submit = async () => { closeModal(); // Reload all cached data in the app queryClient.invalidateQueries({ queryKey: [VUE_QUERY_TX_CHANGE_QUERY] }); - queryClient.invalidateQueries({ - queryKey: [ - VUE_QUERY_CACHE_KEYS.recordsPageTransactionList, - refundTransactionsTypeBasedOnFormType.value, - ], - }); } catch (e) { if (e instanceof ApiErrorResponseError) { addErrorNotification(e.data.message); diff --git a/src/components/dialogs/manage-transaction/record-list.vue b/src/components/dialogs/manage-transaction/record-list.vue index 7e67627..eab0609 100644 --- a/src/components/dialogs/manage-transaction/record-list.vue +++ b/src/components/dialogs/manage-transaction/record-list.vue @@ -48,7 +48,7 @@ const { hasNextPage, isFetched, } = useInfiniteQuery({ - queryKey: [VUE_QUERY_CACHE_KEYS.recordsPageTransactionList, props.transactionType], + queryKey: [...VUE_QUERY_CACHE_KEYS.recordsPageTransactionList, props.transactionType], queryFn: fetchTransactions, initialPageParam: 0, getNextPageParam: (lastPage, pages) => { diff --git a/src/pages/records/records.vue b/src/pages/records/records.vue index 3cfadda..e5dfba9 100644 --- a/src/pages/records/records.vue +++ b/src/pages/records/records.vue @@ -214,7 +214,7 @@ const { hasNextPage, isFetched, } = useInfiniteQuery({ - queryKey: [VUE_QUERY_CACHE_KEYS.recordsPageRecordsList, appliedFilters], + queryKey: [...VUE_QUERY_CACHE_KEYS.recordsPageRecordsList, appliedFilters], queryFn: ({ pageParam }) => fetchTransactions({ pageParam, filter: appliedFilters.value }), initialPageParam: 0, getNextPageParam: (lastPage, pages) => {