Fix error handling for table side panel editor (#34691)

* Fix error handling for table side panel editor

* Minor copy update
This commit is contained in:
Joshen Lim authored and GitHub committed 2025-04-04 16:43:07 +08:00
1 parent caf9a4e962
commit 21cd562f40
2 files changed
+6 -2

No files matched your search

@@ -482,7 +482,9 @@ const SidePanelEditor = ({
}
if (hasError) {
toast(`Table ${table.name} has been updated, but there were some errors`, { id: toastId })
toast.warning(
`Table ${table.name} has been updated but there were some errors. Please check these errors separately.`
)
} else {
if (isTableEditorTabsEnabled && ref && payload.name) {
// [Joshen] Only table entities can be updated via the dashboard
@@ -275,6 +275,7 @@ export const createColumn = async ({
if (!skipSuccessMessage) {
toast.success(`Successfully created column "${column.name}"`, { id: toastId })
}
return { error: undefined }
} catch (error: any) {
toast.error(`An error occurred while creating the column "${payload.name}"`, { id: toastId })
return { error }
@@ -702,7 +703,7 @@ export const updateTable = async ({
...column,
isPrimaryKey: false,
})
await createColumn({
const { error } = await createColumn({
projectRef: projectRef,
connectionString: connectionString,
payload: columnPayload,
@@ -710,6 +711,7 @@ export const updateTable = async ({
skipSuccessMessage: true,
toastId,
})
if (!!error) hasError = true
} else {
const originalColumn = find(originalColumns, { id: column.id })
if (originalColumn) {