({ workspaceId, tableId }: RowMutationContext)
| 2176 | } |
| 2177 | |
| 2178 | export function useDeleteWorkflowGroup({ workspaceId, tableId }: RowMutationContext) { |
| 2179 | const queryClient = useQueryClient() |
| 2180 | return useMutation({ |
| 2181 | mutationFn: async ({ groupId }: DeleteWorkflowGroupVariables) => { |
| 2182 | return requestJson(deleteWorkflowGroupContract, { |
| 2183 | params: { tableId }, |
| 2184 | body: { workspaceId, groupId }, |
| 2185 | }) |
| 2186 | }, |
| 2187 | onError: (error) => { |
| 2188 | if (isValidationError(error)) return |
| 2189 | toast.error(error.message, { duration: 5000 }) |
| 2190 | }, |
| 2191 | onSettled: () => { |
| 2192 | invalidateTableSchema(queryClient, tableId) |
| 2193 | queryClient.invalidateQueries({ queryKey: tableKeys.rowsRoot(tableId) }) |
| 2194 | }, |
| 2195 | }) |
| 2196 | } |
no test coverage detected