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 IPaginatedResult for supported endpoints #477

Merged
merged 15 commits into from
Mar 31, 2021
Merged

Implemented IPaginatedResult for supported endpoints #477

merged 15 commits into from
Mar 31, 2021

Conversation

metasloth
Copy link
Contributor

This is the continued/remaining effort to complete #447, and is also relevant to #288.

Resolves this additional request by @lpinca:

It should be done for all supported endpoints.

LarsBuur and others added 10 commits December 19, 2020 12:05
No original work here. It´s basically what @YourWishes suggests in #288.
Could and should be extended throughout the api for lists.

Usage example:
```
  const orderList: IOrder[] = [];
  const orderStatus = 'any';

  let params = { status: orderStatus, limit: 250 };

  do {
    const orders = await shopify.order.list(params);

    for (const order of orders) {
      orderList.push(order);
    }

    params = orders.nextPageParameters;
  } while (params !== undefined);

  console.log(`after while loop len:${orderList.length}`)
```
No original work here. It´s basically what @YourWishes suggests in #288.
Could and should be extended throughout the api for lists.

Usage example:
```
  const orderList: IOrder[] = [];
  const orderStatus = 'any';

  let params = { status: orderStatus, limit: 250 };

  do {
    const orders = await shopify.order.list(params);

    for (const order of orders) {
      orderList.push(order);
    }

    params = orders.nextPageParameters;
  } while (params !== undefined);

  console.log(`after while loop len:${orderList.length}`)
```
@coveralls
Copy link

coveralls commented Mar 31, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling b7a86b1 on metasloth:master into 68d3b1f on MONEI:master.

index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
@lpinca
Copy link
Collaborator

lpinca commented Mar 31, 2021

Please add Checkout.

metasloth and others added 5 commits March 31, 2021 10:46
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
@metasloth
Copy link
Contributor Author

Please add Checkout.

@lpinca Nice catch, that isn't listed as a supported endpoint by Shopify but I just confirmed the link header is returned at that endpoint.

@lpinca
Copy link
Collaborator

lpinca commented Mar 31, 2021

It is called AbandonedCheckouts in the Shopify documentation. They renamed it some time ago.

@lpinca lpinca merged commit 833f130 into MONEI:master Mar 31, 2021
@lpinca
Copy link
Collaborator

lpinca commented Mar 31, 2021

Thank you.

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.

None yet

4 participants