Skip to content

Commit

Permalink
custom data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed Jul 11, 2024
1 parent c397b16 commit 50fa740
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/Order.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ let Model = {
async setCustomData(criteria, customData) {
await emitter.emit.apply(emitter, ["core:order-set-custom-data", ...arguments]);
let order = await Order.findOne(criteria);
customData = { ...order.customData, customData };
customData = { ...order.customData, ...customData };
await Order.updateOne({ id: order.id }, { customData });
},
async paymentMethodId(criteria) {
Expand Down
2 changes: 1 addition & 1 deletion models/Order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ let Model = {
async setCustomData(criteria: CriteriaQuery<Order>, customData: any): Promise<void> {
await emitter.emit.apply(emitter, ["core:order-set-custom-data", ...arguments]);
let order = await Order.findOne(criteria);
customData = {...order.customData, customData}
customData = {...order.customData, ...customData}
await Order.updateOne({ id: order.id }, {customData});
},

Expand Down

0 comments on commit 50fa740

Please sign in to comment.