260714_01_ENH: 테스트 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
@@ -131,12 +131,25 @@ export function useKartProjectListQuery(args: {
|
||||
}
|
||||
|
||||
/**
|
||||
* 프로젝트에 배정된 외주 userId 목록
|
||||
* KON/KIWI 설문 현황(리포트) 바로가기 URL
|
||||
*/
|
||||
export function useAssignedOutsourceIdsQuery(prjctIdx: number, enabled: boolean) {
|
||||
export function useSurveyRedirectUrlQuery(isKiwi: number, pkey: string, enabled: boolean) {
|
||||
return useQuery({
|
||||
queryKey: qk.projectAssignOutsource(prjctIdx),
|
||||
queryFn: () => nextApi.get<string[]>(`/assign/prjct-outsource/${prjctIdx}`),
|
||||
queryKey: qk.surveyRedirectUrl(isKiwi, pkey),
|
||||
queryFn: () => nextApi.get<string>(`/kart/survey-redirect-url/${isKiwi}/${encodeURIComponent(pkey)}`),
|
||||
enabled: enabled && !!pkey,
|
||||
staleTime: 0,
|
||||
meta: { ignoreGlobalLoading: true },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 프로젝트에 배정된 회사 ID 목록
|
||||
*/
|
||||
export function useAssignedCmpnIdsQuery(prjctIdx: number, enabled: boolean) {
|
||||
return useQuery({
|
||||
queryKey: qk.projectAssignCmpn(prjctIdx),
|
||||
queryFn: () => nextApi.get<string[]>(`/assign/prjct-cmpn/${prjctIdx}`),
|
||||
enabled,
|
||||
staleTime: 0,
|
||||
refetchOnMount: "always",
|
||||
@@ -194,6 +207,19 @@ export function useSaveAssignedFieldworkMutation(prjctIdx: number) {
|
||||
});
|
||||
}
|
||||
|
||||
export function useSaveAssignedCmpnMutation(prjctIdx: number) {
|
||||
const qc = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (cmpnIds: string[]) =>
|
||||
nextApi.put<void>(`/assign/prjct-cmpn/${prjctIdx}`, cmpnIds),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: qk.projectAssignCmpn(prjctIdx) });
|
||||
qc.invalidateQueries({ queryKey: qk.projectInfo(prjctIdx) });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 프로젝트 삭제
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user