Browse Source

fix: include all fields in webhook payload regardless of view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6071/head
Pranav C 1 year ago
parent
commit
801f35b277
  1. 11
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -149,13 +149,18 @@ class BaseModelSqlv2 {
id?: any,
validateFormula = false,
query: any = {},
{
ignoreView = false,
}: {
ignoreView?: boolean;
} = {},
): Promise<any> {
const qb = this.dbDriver(this.tnPath);
const { ast, dependencyFields } = await getAst({
query,
model: this.model,
view: this.viewId && (await View.get(this.viewId)),
view: ignoreView ? null : this.viewId && (await View.get(this.viewId)),
});
await this.selectObject({
@ -2018,7 +2023,7 @@ class BaseModelSqlv2 {
await this.beforeUpdate(data, trx, cookie);
const prevData = await this.readByPk(id);
const prevData = await this.readByPk(id, false, {}, { ignoreView: true });
const query = this.dbDriver(this.tnPath)
.update(updateObj)
@ -2026,7 +2031,7 @@ class BaseModelSqlv2 {
await this.execAndParse(query);
const newData = await this.readByPk(id);
const newData = await this.readByPk(id, false, {}, { ignoreView: true });
await this.afterUpdate(prevData, newData, trx, cookie, updateObj);
return newData;
} catch (e) {

Loading…
Cancel
Save