diff options
author | eug-vs <eug-vs@keemail.me> | 2021-04-26 08:31:36 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-04-26 08:31:36 +0300 |
commit | 092d6b55c05e9ec653b3e51cdecd7274c974b6fb (patch) | |
tree | bf374633cd77cf59ad4f0d87d794e3a09b2e365d /src/services/waybills.service.ts | |
parent | 5cba4b888ce86350b306bd65e7929e9a4f146b01 (diff) | |
download | commercel-api-092d6b55c05e9ec653b3e51cdecd7274c974b6fb.tar.gz |
fix: only add $options to $regex queries
Diffstat (limited to 'src/services/waybills.service.ts')
-rw-r--r-- | src/services/waybills.service.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/services/waybills.service.ts b/src/services/waybills.service.ts index 66225ac..84dba71 100644 --- a/src/services/waybills.service.ts +++ b/src/services/waybills.service.ts @@ -59,8 +59,8 @@ const reflectStatus = async (context: HookContext): Promise<HookContext> => { const addFields = (item: WaybillSchema) => { - const { operation, records, date } = item; - const total = item.records.reduce((sum, record) => sum + record.price * record.quantity, 0); + const { operation, records } = item; + const total = records.reduce((sum, record) => sum + record.price * record.quantity, 0); const op = operation === 'in' ? 'приход' : 'расход'; const name = `Накладная: ${op} ${total}р`; return { ...item, name, total }; |