reintroduced update for draft order

This commit is contained in:
--list committed 2021-06-17 10:40:16 +02:00
1 parent 0223b89a73
commit cc430e3f4d
2 files changed
+25 -20

No files matched your search

@@ -206,4 +206,9 @@ describe("DraftOrderService", () => {
}) })
}) })
describe("update", () => {
fail('implement tests for update');
})
}) })
+20 -20
View File
@@ -338,33 +338,33 @@ class DraftOrderService extends BaseService {
}) })
} }
/** /**
* * Updates a draft order with the given data
* @param {String} doId * @param {String} doId - id of the draft order
* @param {} data * @param {DraftOrder} data - values to update the order with
* @returns * @returns {Promise<DraftOrder>} the updated draft order
*/ */
async update(doId, data){ async update(doId, data){
return this.atomicPhase_(async manager => { return this.atomicPhase_(async manager => {
// const doRepo = manager.getCustomRepository(this.draftOrderRepository_) const doRepo = manager.getCustomRepository(this.draftOrderRepository_)
// const draftOrder = await this.retrieve(doId) const draftOrder = await this.retrieve(doId)
// let touched = false let touched = false
// if(data.no_notification_order !== undefined){ if(data.no_notification_order !== undefined){
// touched = true touched = true
// draftOrder.no_notification_order = data.no_notification_order draftOrder.no_notification_order = data.no_notification_order
// } }
// if(touched){ if(touched){
// doRepo.save(draftOrder) doRepo.save(draftOrder)
// await this.eventBus_ await this.eventBus_
// .withTransaction(manager) .withTransaction(manager)
// .emit(DraftOrderService.Events.UPDATED, { .emit(DraftOrderService.Events.UPDATED, {
// id: draftOrder.id id: draftOrder.id
// }) })
// } }
// return draftOrder return draftOrder
}) })
} }
} }