({ workspaceId, tableId }: RowMutationContext)
| 2152 | } |
| 2153 | |
| 2154 | export function useUpdateWorkflowGroup({ workspaceId, tableId }: RowMutationContext) { |
| 2155 | const queryClient = useQueryClient() |
| 2156 | return useMutation({ |
| 2157 | mutationFn: async (vars: UpdateWorkflowGroupVariables) => { |
| 2158 | return requestJson(updateWorkflowGroupContract, { |
| 2159 | params: { tableId }, |
| 2160 | body: { workspaceId, ...vars }, |
| 2161 | }) |
| 2162 | }, |
| 2163 | onError: (error) => { |
| 2164 | if (isValidationError(error)) return |
| 2165 | toast.error(error.message, { duration: 5000 }) |
| 2166 | }, |
| 2167 | onSettled: () => { |
| 2168 | invalidateTableSchema(queryClient, tableId) |
| 2169 | queryClient.invalidateQueries({ queryKey: tableKeys.rowsRoot(tableId) }) |
| 2170 | }, |
| 2171 | }) |
| 2172 | } |
| 2173 | |
| 2174 | interface DeleteWorkflowGroupVariables { |
| 2175 | groupId: string |
no test coverage detected