Skip to content
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

Merged
merged 8 commits into from
Dec 29, 2018

Conversation

Babanila
Copy link
Contributor

Summary

Fix update error in RestockableInDays

Description

No update is shown when new RestockableInDays value is passed.

Todo

  • Tests
    • Unit
    • Integration

closes #276

@coveralls
Copy link

Coverage Status

Coverage decreased (-63.9%) to 33.713% when pulling 96c2c10 on 276-fix-error-in-restockableInDays into c4ac950 on master.

@coveralls
Copy link

coveralls commented Dec 28, 2018

Coverage Status

Coverage remained the same at 97.635% when pulling 48a5f65 on 276-fix-error-in-restockableInDays into c4ac950 on master.

@daern91 daern91 requested a review from junajan December 28, 2018 18:53
actions = []
if diff.restockableInDays
if _.isArray(diff.restockableInDays)
size = _.size(diff.restockableInDays)
console.log size
Copy link
Contributor

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) ->
Copy link
Member

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
Copy link
Member

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.

@hajoeichler hajoeichler merged commit e3bc859 into master Dec 29, 2018
@hajoeichler hajoeichler deleted the 276-fix-error-in-restockableInDays branch December 29, 2018 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix error in RestockableInDays
4 participants