()
| 127 | * PUT /api/projects/:id |
| 128 | */ |
| 129 | export function useUpdateProject() { |
| 130 | const queryClient = useQueryClient() |
| 131 | |
| 132 | return useMutation({ |
| 133 | mutationFn: ({ id, ...data }: UpdateProjectInput) => |
| 134 | apiClient.put<Project>(`/projects/${id}`, data), |
| 135 | onSuccess: (_data, variables) => { |
| 136 | queryClient.invalidateQueries({ queryKey: queryKeys.projects.all }) |
| 137 | queryClient.invalidateQueries({ |
| 138 | queryKey: queryKeys.projects.detail(variables.id), |
| 139 | }) |
| 140 | }, |
| 141 | }) |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * 删除项目 |
no test coverage detected