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 sku array to string paramters #5

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/stock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = function (restClient) {
}
return false;
}
module.check = (stock) => {
url += `check?sku=${stock.sku}&stockId=${stock.stockId}`;
module.check = (sku, stockId) => {
url += `check?sku=${sku}&stockId=${stockId}`;
return restClient.get(url).then((data)=> {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gibkigonzo ,

I made the change, is it good for you ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey :) thanks for update ❤️
can you please add one more change?

url += `check?sku=${sku}`;
if (stockId) {
  url += `&stockId=${stockId}`;
]

to prevent of creating &stockId=undefined

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good, it's done, thank you.

I still have a question.

It's been a 1 year so I can't remember exactly but to remember it's in this file

https://github.com/DivanteLtd/vue-storefront-api/blob/master/src/api/stock.js#L48

it is an object that we receive as the first parameter.

You made a change here to make it work

https://github.com/DivanteLtd/vue-storefront-api/blob/master/src/api/stock.js#L48

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ow, you are right. Sorry for misleading. Yes, then we need to do this as you proposed

  module.check = (stock) => {
    url += `check?sku=${stock.sku}&stockId=${stock.stockId}`;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the modification :)

return getResponse(data);
});
Expand Down