Skip to content

Commit

Permalink
Update frontend/src/queries/Project.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Pieter Janin <[email protected]>
  • Loading branch information
DRIESASTER and pieterjanin authored May 20, 2024
1 parent 0c7c095 commit fe138a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/queries/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ export function useCreateProjectMutation(): UseMutationReturnType<
}

export function useUpdateProjectMutation(): UseMutationReturnType<
void,
Project,
Error,
{ projectId: number; projectData: Partial<ProjectForm> },
void
> {
const queryClient = useQueryClient();
return useMutation<void, Error, { projectId: number; projectData: Partial<ProjectForm> }, void>(
return useMutation<Project, Error, { projectId: number; projectData: Partial<ProjectForm> }, void>(
{
mutationFn: ({ projectId, projectData }) => updateProject(projectId, projectData),

onSuccess: (_, variables) => {
queryClient.invalidateQueries(PROJECT_QUERY_KEY(variables.projectId));
queryClient.invalidateQueries({ queryKey: PROJECT_QUERY_KEY(variables.projectId) });
console.log("Project updated successfully.");
},

Expand Down

0 comments on commit fe138a0

Please sign in to comment.