Skip to content

Commit

Permalink
Refactor query keys in Lists component
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Oct 30, 2024
1 parent 5bbbd28 commit 7a35cbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/components/Profile/Lists/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const Lists: FC<ListsProps> = ({ profile }) => {
);

queryClient.setQueryData<List[]>(
["getAllLists", currentProfile?.id],
[GET_LISTS_QUERY_KEY, currentProfile?.id],
(oldData) => oldData?.filter((list) => list.id !== id)
);
toast.success("List deleted");
Expand All @@ -90,7 +90,7 @@ const Lists: FC<ListsProps> = ({ profile }) => {
);

queryClient.setQueryData<List[]>(
["getAllLists", currentProfile?.id],
[GET_LISTS_QUERY_KEY, currentProfile?.id],
(oldData) =>
oldData?.map((list) =>
list.id === id ? { ...list, pinned: !pinned } : list
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Shared/Modal/AddToList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const AddToList: FC = () => {
);

queryClient.setQueryData<List[]>(
["getAllLists", profileToAddToList?.id],
[GET_LISTS_QUERY_KEY, profileToAddToList?.id],
(oldData) =>
oldData?.map((list) =>
list.id === listId
Expand Down

1 comment on commit 7a35cbf

@vercel
Copy link

@vercel vercel bot commented on 7a35cbf Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./

web-git-main-heyxyz.vercel.app
heyxyz.vercel.app
web-heyxyz.vercel.app
hey.xyz

Please sign in to comment.