Skip to content

Commit ef4688a

Browse files
committed
fix: fix checking if field unique for updateRecord
1 parent b733b6e commit ef4688a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adminforth/dataConnectors/baseConnector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export default class AdminForthBaseConnector implements IAdminForthDataSourceCon
331331
let error: string | null = null;
332332
await Promise.all(
333333
resource.dataSourceColumns.map(async (col) => {
334-
if (col.isUnique && !col.virtual && !error) {
334+
if (col.isUnique && !col.virtual && !error && Object.prototype.hasOwnProperty.call(recordWithOriginalValues, col.name)) {
335335
const exists = await this.checkUnique(resource, col, recordWithOriginalValues[col.name], record);
336336
if (exists) {
337337
error = `Record with ${col.name} ${recordWithOriginalValues[col.name]} already exists`;

0 commit comments

Comments
 (0)