File tree 2 files changed +2
-6
lines changed
2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,12 @@ export default function useLikeBoard() {
20
20
[ queryKeys . BOARD_LIST ] ,
21
21
( oldData ) => {
22
22
if ( oldData ) {
23
- const updatedData = { ...oldData } ;
24
- const updatedBoard = updatedData . content ?. find (
23
+ const updatedBoard = oldData . content ?. find (
25
24
( board ) => board . id === boardId ,
26
25
) ;
27
26
if ( updatedBoard ) {
28
27
updatedBoard . boardLiked = true ;
29
28
}
30
- return updatedData ;
31
29
}
32
30
return oldData ;
33
31
} ,
Original file line number Diff line number Diff line change @@ -20,14 +20,12 @@ export default function useUnlikeBoard() {
20
20
[ queryKeys . BOARD_LIST ] ,
21
21
( oldData ) => {
22
22
if ( oldData ) {
23
- const updatedData = { ...oldData } ;
24
- const updatedBoard = updatedData . content ?. find (
23
+ const updatedBoard = oldData . content ?. find (
25
24
( board ) => board . id === boardId ,
26
25
) ;
27
26
if ( updatedBoard ) {
28
27
updatedBoard . boardLiked = false ;
29
28
}
30
- return updatedData ;
31
29
}
32
30
return oldData ;
33
31
} ,
You can’t perform that action at this time.
0 commit comments