260427_01_ENH: 리스트 다이얼로그 및 리스트 작업 시작
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import {useQuery, keepPreviousData, useQueryClient, useMutation} from "@tanstack/react-query";
|
||||
import { nextApi } from "@/lib/http-client";
|
||||
import { qk } from "@/query/keys";
|
||||
import { qk } from "@/query/key/keys";
|
||||
import type {
|
||||
KonKiwiProjectInfo,
|
||||
ProjectCreateRequest,
|
||||
@@ -135,7 +135,7 @@ export function useKartProjectListQuery(args: {
|
||||
*/
|
||||
export function useAssignedOutsourceIdsQuery(prjctIdx: number, enabled: boolean) {
|
||||
return useQuery({
|
||||
queryKey: qk.assignOutsource(prjctIdx),
|
||||
queryKey: qk.projectAssignOutsource(prjctIdx),
|
||||
queryFn: () => nextApi.get<string[]>(`/assign/prjct-outsource/${prjctIdx}`),
|
||||
enabled,
|
||||
staleTime: 0,
|
||||
@@ -145,7 +145,7 @@ export function useAssignedOutsourceIdsQuery(prjctIdx: number, enabled: boolean)
|
||||
|
||||
export function useAssignedFieldworkIdsQuery(prjctIdx: number, enabled: boolean) {
|
||||
return useQuery({
|
||||
queryKey: qk.assignFieldwork(prjctIdx),
|
||||
queryKey: qk.projectAssignFieldwork(prjctIdx),
|
||||
queryFn: () => nextApi.get<string[]>(`/assign/prjct-fieldwork/${prjctIdx}`),
|
||||
enabled,
|
||||
staleTime: 0,
|
||||
@@ -189,7 +189,7 @@ export function useSaveAssignedFieldworkMutation(prjctIdx: number) {
|
||||
mutationFn: (userIds: string[]) =>
|
||||
nextApi.put<void>(`/assign/prjct-fieldwork/${prjctIdx}`, userIds),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: qk.assignFieldwork(prjctIdx) });
|
||||
qc.invalidateQueries({ queryKey: qk.projectAssignFieldwork(prjctIdx) });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user