fix: Read api - if record is missing return null
@ -172,7 +172,7 @@ class BaseModelSqlv2 {
data.__proto__ = proto;
}
return data ? await nocoExecute(ast, data, {}, query) : {};
return data ? await nocoExecute(ast, data, {}, query) : null;
public async exist(id?: any): Promise<any> {
@ -282,7 +282,7 @@ function baseModelSqlTests() {
const deletedRow = await baseModelSql.readByPk(rowIdToDeleted);
expect(deletedRow).to.be.an('object').that.is.empty;
expect(deletedRow).to.be.null;
console.log('Delete record', await Audit.projectAuditList(project.id, {}));
const rowDeletedAudit = (await Audit.projectAuditList(project.id, {})).find(