diff --git a/apps/frontend/src/pages/[type]/[project].vue b/apps/frontend/src/pages/[type]/[project].vue index 71f4d8b9ef..948e98b6f1 100644 --- a/apps/frontend/src/pages/[type]/[project].vue +++ b/apps/frontend/src/pages/[type]/[project].vue @@ -1454,8 +1454,8 @@ const patchProjectMutation = useMutation({ // Mutation for changing project status (setProcessing) const patchStatusMutation = useMutation({ - mutationFn: async ({ projectId, status }) => { - await client.labrinth.projects_v2.edit(projectId, { status }) + mutationFn: async (variables) => { + await client.labrinth.projects_v2.edit(variables.projectId, { status: variables.status }) }, onMutate: async ({ projectId, status }) => { @@ -1471,6 +1471,12 @@ const patchStatusMutation = useMutation({ return { previousProject, projectId } }, + onSuccess: async (_data, { threadId }) => { + if (threadId) { + await queryClient.invalidateQueries({ queryKey: ['thread', threadId] }) + } + }, + onError: (err, _variables, context) => { if (context?.previousProject) { queryClient.setQueryData(['project', 'v2', context.projectId], context.previousProject) @@ -2161,7 +2167,11 @@ async function setProcessing() { startLoading() patchStatusMutation.mutate( - { projectId: project.value.id, status: 'processing' }, + { + projectId: project.value.id, + status: 'processing', + threadId: project.value.thread_id, + }, { onSettled: () => stopLoading() }, ) }