Skip to content

Commit 8071379

Browse files
committed
chore: update error message for the column, that not exists in database table
1 parent f7383c9 commit 8071379

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adminforth/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,15 @@ class AdminForth implements IAdminForth {
422422
res.columns.forEach((col, i) => {
423423
if (!fieldTypes[col.name] && !col.virtual) {
424424
const similar = suggestIfTypo(Object.keys(fieldTypes), col.name);
425-
throw new Error(`Resource '${res.table}' has no column '${col.name}'. ${similar ? `Did you mean '${similar}'?` : ''}`);
425+
throw new Error(`Table '${res.table}' has no column '${col.name}'. ${similar ? `Did you mean '${similar}'?` : ''}`);
426426
}
427427
// first find discovered values, but allow override
428428
res.columns[i] = { ...fieldTypes[col.name], ...col };
429429
});
430430

431431
// check if primaryKey column is present
432432
if (!res.columns.some((col) => col.primaryKey)) {
433-
throw new Error(`Resource '${res.table}' has no column defined or auto-discovered. Please set 'primaryKey: true' in a columns which has unique value for each record and index`);
433+
throw new Error(`Table '${res.table}' has no column defined or auto-discovered. Please set 'primaryKey: true' in a columns which has unique value for each record and index`);
434434
}
435435

436436
}));

0 commit comments

Comments
 (0)