* Toasts a failed row write. A plan row-limit failure (the best-effort cap in * `assertRowCapacity`) gets an "Upgrade" action routing to the explore-plans page; * other errors are a plain auto-dismissing toast. Validation errors are surfaced * inline, not here.
(error: Error, onUpgrade: () => void)
| 613 | * inline, not here. |
| 614 | */ |
| 615 | function notifyRowWriteError(error: Error, onUpgrade: () => void): void { |
| 616 | if (isValidationError(error)) return |
| 617 | if (error.message.toLowerCase().includes('row limit')) { |
| 618 | toast.error(error.message, { |
| 619 | action: { label: 'Upgrade', onClick: onUpgrade }, |
| 620 | }) |
| 621 | return |
| 622 | } |
| 623 | toast.error(error.message, { duration: 5000 }) |
| 624 | } |
| 625 | |
| 626 | export function useCreateTableRow({ workspaceId, tableId }: RowMutationContext) { |
| 627 | const queryClient = useQueryClient() |
no test coverage detected