Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Commit 527c30e

Browse files
committed
fix: old stock counts don't have amount prop
1 parent 9c55c6c commit 527c30e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/state-indicators.service.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ class StateIndicatorsService {
104104

105105
const decoratedStock = Object.keys(stock).reduce((decorated, product) => {
106106
// v2 stock count report
107-
let amount = stock[product].amount
107+
let amount = 0
108+
if (!isNaN(parseInt(stock[product].amount, 10))) {
109+
amount = stock[product].amount
110+
} else if (!isNaN(parseInt(stock[product], 10))) {
111+
amount = stock[product]
112+
}
108113
let status
109114
let allocation
110115
let productThresholds

0 commit comments

Comments
 (0)