Browse Source

feat: method for updating last modified time programmatically

pull/7304/head
Pranav C 9 months ago
parent
commit
2ecd6c1c21
  1. 16
      packages/nocodb/src/db/BaseModelSqlv2.ts

16
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -3846,7 +3846,7 @@ class BaseModelSqlv2 {
}
// method for validating otpions if column is single/multi select
private async validateOptions(
private async avalidateOptions(
column: Column<any>,
insertOrUpdateObject: Record<string, any>,
) {
@ -5515,6 +5515,20 @@ class BaseModelSqlv2 {
}
}
async updateLastModifiedTime({ rowIds }: { rowIds: any | any[] }) {
const columnName = 'updated_at';
const qb = this.dbDriver(this.tnPath).update({
[columnName]: this.dbDriver.fn.now(),
});
for(const rowId of rowIds) {
qb.orWhere(await this._wherePk(rowId));
}
await qb;
}
async prepareNocoData(data) {
if (
this.model.columns.some((c) =>

Loading…
Cancel
Save