Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Query keys invalidation #313

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading