Skip to content

removed depreciation from consignment apis#36

Open
chronos25 wants to merge 8 commits into
fixes/ritik/addedDeleteFieldForProductTypefrom
fix/ritik/depreciation/consignmentApi
Open

removed depreciation from consignment apis#36
chronos25 wants to merge 8 commits into
fixes/ritik/addedDeleteFieldForProductTypefrom
fix/ritik/depreciation/consignmentApi

Conversation

@chronos25

Copy link
Copy Markdown

No description provided.

@chronos25 chronos25 requested a review from kamal0808 August 24, 2023 06:55
Comment thread 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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

getOrdersFromSuppliers?.data || getOrdersFromSuppliers

Comment thread lib/consignment.js
}

var path = '/api/1.0/consignment/' + args.apiId.value;
var path = '/api/2.0/consignments/' + args.apiId.value;

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No

@kamal0808

Copy link
Copy Markdown
Collaborator

@chronos25 this can be merged.

Comment thread lib/consignment.js Outdated

var path = '/api/consignment_product';
var path = `/api/2.0/consignments/${args.consignmentId.value}/products`;
//var path = '/api/consignment_product';

Copy link
Copy Markdown
Collaborator

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

Comment thread lib/consignment.js
return utils.sendRequest(options, args, connectionInfo, fetchProductsByConsignment, retryCounter);
return utils.sendRequest(options, args, connectionInfo, fetchProductsByConsignment, retryCounter)
.then(function(response){
return response.data;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

add a catch block

Comment thread lib/consignment.js

var path = '/api/consignment_product';
var path = `/api/2.0/consignments/${args.body.consignment_id}/products`;
//var path = '/api/consignment_product';

Copy link
Copy Markdown
Collaborator

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

Comment thread lib/consignment.js
return Promise.reject(error);
}
return Promise.resolve(response);
return Promise.resolve(response.data);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

catch block required

Comment thread lib/consignment.js Outdated
return utils.sendRequest(options, args, connectionInfo, createStockOrder, retryCounter)
.then(function(response){
return response.data;
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

catch block

Comment thread lib/consignment.js
return utils.sendRequest(options, args, connectionInfo, updateConsignmentProduct, retryCounter);
return utils.sendRequest(options, args, connectionInfo, updateConsignmentProduct, retryCounter)
.then(function(response){
return response.data;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

catch block

Comment thread lib/consignment.js
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsSent, retryCounter);
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsSent, retryCounter)
.then(function(response){
return response.data;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

catch block

Comment thread lib/consignment.js
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsReceived, retryCounter);
return utils.sendRequest(options, args, connectionInfo, markStockOrderAsReceived, retryCounter)
.then(function(response){
return response.data;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

catch block

Comment thread 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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

catch block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants