-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: master
Are you sure you want to change the base?
Conversation
@@ -8,8 +8,8 @@ module.exports = function (restClient) { | |||
} | |||
return false; | |||
} | |||
module.check = (sku) => { | |||
url += `check?sku=${sku}`; | |||
module.check = (stock) => { |
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.
we need to keep backward compatibility, can you please change it to module.check = (sku, stockId) => {
?
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)=> { |
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.
Hi @gibkigonzo ,
I made the change, is it good for you ?
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.
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
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'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
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.
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}`;
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.
I made the modification :)
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.
thanks :)
view store front api changed sku parameters from string to array
{sku: '123', stockId:null}