mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-22 21:28:12 +02:00
feat(model-connections): implement bulk model update endpoint and related schema changes
This commit is contained in:
parent
ad404b2dbc
commit
ced1bb85ed
7 changed files with 538 additions and 168 deletions
|
|
@ -6,6 +6,7 @@ import type {
|
|||
ModelCreateRequest,
|
||||
ModelRead,
|
||||
ModelRoles,
|
||||
ModelsBulkUpdateRequest,
|
||||
ModelUpdateRequest,
|
||||
VerifyConnectionResponse,
|
||||
} from "@/contracts/types/model-connections.types";
|
||||
|
|
@ -127,6 +128,17 @@ export const updateModelMutationAtom = atomWithMutation((get) => {
|
|||
};
|
||||
});
|
||||
|
||||
export const bulkUpdateModelsMutationAtom = atomWithMutation((get) => {
|
||||
const searchSpaceId = Number(get(activeSearchSpaceIdAtom));
|
||||
return {
|
||||
mutationKey: ["models", "bulk-update"],
|
||||
mutationFn: ({ connectionId, data }: { connectionId: number; data: ModelsBulkUpdateRequest }) =>
|
||||
modelConnectionsApiService.bulkUpdateModels(connectionId, data),
|
||||
onSuccess: () => invalidateModelConnections(searchSpaceId),
|
||||
onError: (error: Error) => toast.error(error.message || "Failed to update models"),
|
||||
};
|
||||
});
|
||||
|
||||
export const testModelMutationAtom = atomWithMutation((get) => {
|
||||
const searchSpaceId = Number(get(activeSearchSpaceIdAtom));
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue