diff --git a/packages/nocodb/src/meta/meta.service.ts b/packages/nocodb/src/meta/meta.service.ts index 4d75c79437..14a8cf6612 100644 --- a/packages/nocodb/src/meta/meta.service.ts +++ b/packages/nocodb/src/meta/meta.service.ts @@ -447,7 +447,7 @@ export class MetaService { // Check if a condition is present in the query builder and throw an error if not. if (!force) { - this.checkConditionPresent(query); + this.checkConditionPresent(query, 'delete'); } return query.del(); @@ -726,7 +726,7 @@ export class MetaService { // Check if a condition is present in the query builder and throw an error if not. if (!force) { - this.checkConditionPresent(query); + this.checkConditionPresent(query, 'update'); } return await query; @@ -1206,7 +1206,10 @@ export class MetaService { * * @param queryBuilder - The Knex QueryBuilder instance to check. */ - private checkConditionPresent(queryBuilder: Knex.QueryBuilder) { + private checkConditionPresent( + queryBuilder: Knex.QueryBuilder, + operation: 'delete' | 'update', + ) { // Convert the query builder to a SQL string to inspect the presence of a WHERE clause. const sql = queryBuilder.toString(); @@ -1219,7 +1222,7 @@ export class MetaService { // Throw an error if no condition is found in the query builder. NcError.metaError({ - message: 'Condition is required', + message: 'A condition is required to ' + operation + ' records.', sql, }); }