-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(inventory.coffee): fix error in restockable in days #277
Conversation
actions = [] | ||
if diff.restockableInDays | ||
if _.isArray(diff.restockableInDays) | ||
size = _.size(diff.restockableInDays) | ||
console.log size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably was a testing print? 🙂
@@ -49,23 +49,23 @@ class InventoryUtils extends BaseUtils | |||
# diff - {Object} The result of diff from `jsondiffpatch` | |||
# | |||
# Returns {Array} The list of actions, or empty if there are none | |||
actionsMapRestockableInDays: (diff) -> | |||
actionsMapRestockableInDays: (diff, old_obj) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you get the old_obj here, but you don't use it.
if size is 1 | ||
a.restockableInDays = diff.restockableInDays[0] | ||
else if size is 2 | ||
if size is 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't change the order of the if/else statement, the actual change is one line.
Summary
Fix update error in RestockableInDays
Description
No update is shown when new RestockableInDays value is passed.
Todo
closes #276