* commit at some point in the middle, WIP * formatting * ci passing * comments * handle no jobid case * better error handling * comments * Update orchestrator/src/client/hooks/queries/useJobMutations.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update orchestrator/src/client/hooks/queries/useSettingsMutation.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * better types * formatter * tracking inbox page * in progress page * tracer links page * invalidate harder * ensure tracer links docs show --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
15 lines
510 B
TypeScript
15 lines
510 B
TypeScript
import * as api from "@client/api";
|
|
import type { UpdateSettingsInput } from "@shared/settings-schema";
|
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
import { invalidateSettingsData } from "./invalidate";
|
|
|
|
export function useUpdateSettingsMutation() {
|
|
const queryClient = useQueryClient();
|
|
return useMutation({
|
|
mutationFn: (payload: UpdateSettingsInput) => api.updateSettings(payload),
|
|
onSuccess: async () => {
|
|
await invalidateSettingsData(queryClient);
|
|
},
|
|
});
|
|
}
|