Skip to content

Commit 55ea86e

Browse files
CopilotkingRayhan
andauthored
fix: use full queryKey in cancelQueries for dashboard article mutations
Agent-Logs-Url: https://github.com/techdiary-dev/techdiary.dev/sessions/a0bc19b6-228e-48b9-8d7b-e5422cb0c559 Co-authored-by: kingRayhan <7611746+kingRayhan@users.noreply.github.com>
1 parent 1de564c commit 55ea86e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/dashboard/_components/DashboardArticleList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const DashboardArticleList = () => {
7070
enableToast: true,
7171
}),
7272
onMutate: async (article_id: string) => {
73-
await queryClient.cancelQueries({ queryKey: ["dashboard-articles"] });
73+
await queryClient.cancelQueries({ queryKey: ["dashboard-articles", sortBy, sortOrder, status] });
7474

7575
const previousData = queryClient.getQueryData(["dashboard-articles", sortBy, sortOrder, status]);
7676

@@ -110,7 +110,7 @@ const DashboardArticleList = () => {
110110
{ enableToast: true }
111111
),
112112
onMutate: async (article_id: string) => {
113-
await queryClient.cancelQueries({ queryKey: ["dashboard-articles"] });
113+
await queryClient.cancelQueries({ queryKey: ["dashboard-articles", sortBy, sortOrder, status] });
114114

115115
const previousData = queryClient.getQueryData(["dashboard-articles", sortBy, sortOrder, status]);
116116

0 commit comments

Comments
 (0)