Skip to content

Commit

Permalink
Merge pull request #313 from letehaha/fix/query-keys-invalidation
Browse files Browse the repository at this point in the history
fix: Query keys invalidation
  • Loading branch information
letehaha committed Sep 22, 2024
2 parents 03a12b5 + d28fe5b commit fbcb971
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const {
isFetched,
} = useInfiniteQuery({
queryKey: [
VUE_QUERY_CACHE_KEYS.recordsPageTransactionList,
...VUE_QUERY_CACHE_KEYS.recordsPageTransactionList,
props.transactionType,
appliedFilters,
],
Expand Down
7 changes: 0 additions & 7 deletions src/components/dialogs/manage-transaction/dialog-content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/manage-transaction/record-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/records/records.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit fbcb971

Please sign in to comment.