Refactor: 쿼리 단순화
This commit is contained in:
parent
9098694d99
commit
1c9bd12f1b
@ -1,20 +1,10 @@
|
||||
import { uploadImageFolderFile } from '@/api/imageApi';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { UploadFolderParams } from '@/types/uploadTypes';
|
||||
|
||||
export default function useUploadImageFolderFileQuery() {
|
||||
return useMutation({
|
||||
mutationFn: ({
|
||||
memberId,
|
||||
projectId,
|
||||
folderId,
|
||||
files,
|
||||
progressCallback,
|
||||
}: {
|
||||
memberId: number;
|
||||
projectId: number;
|
||||
folderId: number;
|
||||
files: File[];
|
||||
progressCallback: (progress: number) => void;
|
||||
}) => uploadImageFolderFile(memberId, projectId, folderId, files, progressCallback),
|
||||
mutationFn: ({ memberId, projectId, folderId, files, progressCallback }: UploadFolderParams) =>
|
||||
uploadImageFolderFile(memberId, projectId, folderId, files, progressCallback),
|
||||
});
|
||||
}
|
||||
|
@ -1,20 +1,10 @@
|
||||
import { uploadImageZip } from '@/api/imageApi';
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { UploadZipParams } from '@/types/uploadTypes';
|
||||
|
||||
export default function useUploadImageZipQuery() {
|
||||
return useMutation({
|
||||
mutationFn: ({
|
||||
memberId,
|
||||
projectId,
|
||||
folderId,
|
||||
file,
|
||||
progressCallback,
|
||||
}: {
|
||||
memberId: number;
|
||||
projectId: number;
|
||||
folderId: number;
|
||||
file: File;
|
||||
progressCallback: (progress: number) => void;
|
||||
}) => uploadImageZip(memberId, projectId, folderId, file, progressCallback),
|
||||
mutationFn: ({ memberId, projectId, folderId, file, progressCallback }: UploadZipParams) =>
|
||||
uploadImageZip(memberId, projectId, folderId, file, progressCallback),
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user