MCPcopy Index your code
hub / github.com/simstudioai/sim / useDeleteTableRow

Function useDeleteTableRow

apps/sim/hooks/queries/tables.ts:1020–1038  ·  view source on GitHub ↗
({ workspaceId, tableId }: RowMutationContext)

Source from the content-addressed store, hash-verified

1018 * Delete a single row from a table.
1019 */
1020export function useDeleteTableRow({ workspaceId, tableId }: RowMutationContext) {
1021 const queryClient = useQueryClient()
1022
1023 return useMutation({
1024 mutationFn: async (rowId: string) => {
1025 return requestJson(deleteTableRowContract, {
1026 params: { tableId, rowId },
1027 body: { workspaceId },
1028 })
1029 },
1030 onError: (error) => {
1031 if (isValidationError(error)) return
1032 toast.error(error.message, { duration: 5000 })
1033 },
1034 onSettled: () => {
1035 invalidateRowCount(queryClient, tableId)
1036 },
1037 })
1038}
1039
1040/**
1041 * Delete multiple rows from a table.

Callers 2

RowModalFunction · 0.90
useTableUndoFunction · 0.90

Calls 4

requestJsonFunction · 0.90
isValidationErrorFunction · 0.90
invalidateRowCountFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected