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

Implemented: API calls to get user preferred store and ecom stores in user module #74

Closed

Conversation

sanskar345
Copy link

Related Issues

Related - hotwax/dxp-components#193

Short Description and Why It's Useful

Screenshots of Visual Changes before/after (If There Are Any)

Contribution and Currently Important Rules Acceptance

}
}

async function getEComStores (facilityId: string, token: any, baseURL: string): Promise<Response> {

Choose a reason for hiding this comment

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

Why are mentioning the returned type as Promise<Response>

'Content-Type': 'application/json'
}
});
if (hasError(resp) || resp.data.docs.length === 0) {

Choose a reason for hiding this comment

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

This check might not be required resp.data.docs.length === 0

if (hasError(resp)) {
return Promise.reject(resp.data)
}
return Promise.resolve(resp.data.userPrefValue ? resp.data.userPrefValue : '');

Choose a reason for hiding this comment

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

Suggested change
return Promise.resolve(resp.data.userPrefValue ? resp.data.userPrefValue : '');
return Promise.resolve(resp.data.userPrefValue);

@ymaheshwari1
Copy link
Contributor

Closing as handled in #87

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.

3 participants