-
Notifications
You must be signed in to change notification settings - Fork 7
removed depreciation from consignment apis #36
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
base: fixes/ritik/addedDeleteFieldForProductType
Are you sure you want to change the base?
removed depreciation from consignment apis #36
Conversation
lib/consignment.js
Outdated
|
||
return utils.sendRequest(options, args, connectionInfo, fetchStockOrdersForSuppliers, retryCounter); | ||
const getOrdersFromSuppliers = utils.sendRequest(options, args, connectionInfo, fetchStockOrdersForSuppliers, retryCounter); | ||
const result = getOrdersFromSuppliers?.data ? getOrdersFromSuppliers?.data : getOrdersFromSuppliers; |
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.
getOrdersFromSuppliers?.data || getOrdersFromSuppliers
} | ||
|
||
var path = '/api/1.0/consignment/' + args.apiId.value; | ||
var path = '/api/2.0/consignments/' + args.apiId.value; |
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.
have you considered creating a new path instead of replacing the existing ones?
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.
No
@chronos25 this can be merged. |
lib/consignment.js
Outdated
|
||
var path = '/api/consignment_product'; | ||
var path = `/api/2.0/consignments/${args.consignmentId.value}/products`; | ||
//var path = '/api/consignment_product'; |
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.
Remove this commented code before merging, or add the deprecation notice URL in the comment somewhere with reason @chronos25
return utils.sendRequest(options, args, connectionInfo, fetchProductsByConsignment, retryCounter); | ||
return utils.sendRequest(options, args, connectionInfo, fetchProductsByConsignment, retryCounter) | ||
.then(function(response){ | ||
return response.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.
add a catch block
|
||
var path = '/api/consignment_product'; | ||
var path = `/api/2.0/consignments/${args.body.consignment_id}/products`; | ||
//var path = '/api/consignment_product'; |
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.
get rid of commented code or add reason for commenting
return Promise.reject(error); | ||
} | ||
return Promise.resolve(response); | ||
return Promise.resolve(response.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.
catch block required
lib/consignment.js
Outdated
return utils.sendRequest(options, args, connectionInfo, createStockOrder, retryCounter) | ||
.then(function(response){ | ||
return response.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.
catch block
return utils.sendRequest(options, args, connectionInfo, updateConsignmentProduct, retryCounter); | ||
return utils.sendRequest(options, args, connectionInfo, updateConsignmentProduct, retryCounter) | ||
.then(function(response){ | ||
return response.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.
catch block
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsSent, retryCounter); | ||
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsSent, retryCounter) | ||
.then(function(response){ | ||
return response.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.
catch block
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsReceived, retryCounter); | ||
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsReceived, retryCounter) | ||
.then(function(response){ | ||
return response.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.
catch block
lib/consignment.js
Outdated
return utils.sendRequest(options, args, connectionInfo, deleteStockOrder, retryCounter); | ||
return utils.sendRequest(options, args, connectionInfo, deleteStockOrder, retryCounter) | ||
.then(function(response){ | ||
return response.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.
catch block
No description provided.