Skip to content

Commit ac56b9f

Browse files
committed
fixes for better-sqlite
1 parent 821dd6b commit ac56b9f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/change-log.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ const _formatAssociationContext = async function (changes) {
125125
SELECT.one.from(a.target).where({ [ID]: change.valueChangedTo })
126126
])
127127

128-
const fromObjId = await getObjectId(a.target, semkeys, { curObjFromDbQuery: from })
128+
const fromObjId = await getObjectId(a.target, semkeys, { curObjFromDbQuery: from || undefined }) // Note: ... || undefined is important for subsequent object destructuring with defaults
129129
if (fromObjId) change.valueChangedFrom = fromObjId
130130

131-
const toObjId = await getObjectId(a.target, semkeys, { curObjFromDbQuery: to })
131+
const toObjId = await getObjectId(a.target, semkeys, { curObjFromDbQuery: to || undefined }) // Note: ... || undefined is important for subsequent object destructuring with defaults
132132
if (toObjId) change.valueChangedTo = toObjId
133133

134134
const isVLvA = a["@Common.ValueList.viaAssociation"]

tests/integration/fiori-draft-enabled.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe("change log integration test", () => {
5555
expect(bookChange.valueChangedFrom).to.equal("");
5656
expect(bookChange.valueChangedTo).to.equal("test title");
5757

58-
const titleChanges = await await adminService.run(
58+
const titleChanges = await adminService.run(
5959
SELECT.from(ChangeView).where({
6060
entity: "sap.capire.bookshop.Books",
6161
attribute: "title",
@@ -72,7 +72,7 @@ describe("change log integration test", () => {
7272
expect(titleChange.valueChangedFrom).to.equal("");
7373
expect(titleChange.valueChangedTo).to.equal("test title");
7474

75-
const authorChanges = await await adminService.run(
75+
const authorChanges = await adminService.run(
7676
SELECT.from(ChangeView).where({
7777
entity: "sap.capire.bookshop.Books",
7878
attribute: "author",

0 commit comments

Comments
 (0)