260316:1117 20260316:1100 Refactor UUID
Build and Deploy / deploy (push) Successful in 9m24s

This commit is contained in:
admin
2026-03-16 11:17:15 +07:00
parent b93cd91325
commit c5c3ed9016
92 changed files with 1726 additions and 620 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import { getApiErrorMessage } from '@/types/api-error';
export const projectKeys = {
all: ['projects'] as const,
list: (params: SearchProjectDto) => [...projectKeys.all, 'list', params] as const,
detail: (id: number) => [...projectKeys.all, 'detail', id] as const,
detail: (uuid: string) => [...projectKeys.all, 'detail', uuid] as const,
};
export function useProjects(params?: SearchProjectDto) {
@@ -36,7 +36,7 @@ export function useCreateProject() {
export function useUpdateProject() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ id, data }: { id: number; data: UpdateProjectDto }) => projectService.update(id, data),
mutationFn: ({ uuid, data }: { uuid: string; data: UpdateProjectDto }) => projectService.update(uuid, data),
onSuccess: () => {
toast.success("Project updated successfully");
queryClient.invalidateQueries({ queryKey: projectKeys.all });
@@ -52,7 +52,7 @@ export function useUpdateProject() {
export function useDeleteProject() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (id: number) => projectService.delete(id),
mutationFn: (uuid: string) => projectService.delete(uuid),
onSuccess: () => {
toast.success("Project deleted successfully");
queryClient.invalidateQueries({ queryKey: projectKeys.all });