Browse Source

fix: small changes

pull/8901/head
Ramesh Mane 5 months ago
parent
commit
7d026cf99d
  1. 23
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -6233,7 +6233,9 @@ class BaseModelSqlv2 {
`Record [id:${childId}] has been linked with record [id:${rowId}] in ${model.title}`, `Record [id:${childId}] has been linked with record [id:${rowId}] in ${model.title}`,
), ),
details: DOMPurify.sanitize(`<span class="">${columnTitle}</span> details: DOMPurify.sanitize(`<span class="">${columnTitle}</span>
: <span class="black--text green lighten-4 px-2">${pkValue ?? null}</span>`), : <span class="black--text green lighten-4 px-2">${
pkValue ?? null
}</span>`),
ip: req?.clientIp, ip: req?.clientIp,
user: req?.user?.email, user: req?.user?.email,
}); });
@ -6455,12 +6457,15 @@ class BaseModelSqlv2 {
pkValue = undefined, pkValue = undefined,
): Promise<void> { ): Promise<void> {
if (!pkValue) { if (!pkValue) {
pkValue = await this.dbDriver(this.getTnPath(childModel)) pkValue = await this.readByPkFromModel(
.select( childModel,
`${childModel.table_name}.${childModel.displayValue.column_name}`, undefined,
) true,
.where(_wherePk(childModel.primaryKeys, childId)) childId,
.first(); false,
{},
{ ignoreView: true, getHiddenColumn: true, extractOnlyPrimaries: true },
);
} }
await Audit.insert({ await Audit.insert({
@ -6476,7 +6481,9 @@ class BaseModelSqlv2 {
), ),
details: DOMPurify.sanitize(`<span class="">${columnTitle}</span> details: DOMPurify.sanitize(`<span class="">${columnTitle}</span>
: <span class="text-decoration-line-through red px-2 lighten-4 black--text">${ : <span class="text-decoration-line-through red px-2 lighten-4 black--text">${
Object.values(pkValue)[0] typeof pkValue === 'object'
? Object.values(pkValue)[0]
: pkValue ?? null
}</span>`), }</span>`),
ip: req?.clientIp, ip: req?.clientIp,
user: req?.user?.email, user: req?.user?.email,

Loading…
Cancel
Save