Shopify / shopify-api-js

Shopify Admin API Library for Node. Accelerate development with support for authentication, graphql proxy, webhooks
MIT License
944 stars 390 forks source link

Customer Addresses doesn't parse correctly #384

Closed adameichelkraut closed 2 years ago

adameichelkraut commented 2 years ago

Issue summary

Write a short description of the issue here ↓

Hi! I started using the Shopify SDK and wanted to use the customer addresses API to get addresses from a customer.

Expected behavior

I should get a list of the customer's addresses. I believe that the parsing of the PLURAL_NAME is not parsing the name of addresses that the API sends back ... but rather trying to parse customer_addresses.

Actual behavior

The SDK returns an empty list, but I should expect to have a list with the customer's addresses.

Tip: include an error message (in a <details></details> tag) if your issue is related to an error

Steps to reproduce the problem

const addresses = await CustomerAddress.all({
    session: testSession,
    customer_id: "<a customer id>"
});

console.log("Addresses", addresses);

I noticed that if I did the below, it works though :)

(CustomerAddress as any).PLURAL_NAME = "addresses";
const addresses = await CustomerAddress.all({
    session: testSession,
    customer_id: "<a customer id>"
});

console.log("Addresses", addresses);
github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] commented 2 years ago

We are closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!