Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MariaJose
Copy link
Contributor

@MariaJose MariaJose commented Jul 20, 2023

What?

The Node API client is broken. Recently, breaking changes have been introduced to the API Specs repo - this has caused the Node API client to break as Catalog has been converted from a file to a directory of files.

Tickets / Documentation

APPEX-585

Testing

Updated and added unit tests
Files are generated when running npm run generate

cc @bigcommerce/gta-dt

@MariaJose MariaJose changed the title Appex 585 fix: APPEX-585 udpate catalog typing Jul 20, 2023
@MariaJose MariaJose marked this pull request as ready for review July 20, 2023 15:01
rtalvarez
rtalvarez previously approved these changes Jul 20, 2023
const remoteSourceDir = await this.client.get<GitHubRepoTree>(targetDir.url);
const specFileNames = remoteSourceDir.data.tree.map(file => `${this.CONTENT_URL}${file.path}`);

const specFileNames = await remoteSourceDir.data.tree.reduce(
Copy link
Contributor

Choose a reason for hiding this comment

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

🍹 since this is a deeply nested prop, should we consider adding in optional chaining?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should be fine, based on the GIT trees api, the elements that we are chaining should be defined as either a tree type or string type👍🏼 . Reference: https://docs.github.com/en/rest/git/trees?apiVersion=2022-11-28

Copy link
Contributor

@bc-chaz bc-chaz left a comment

Choose a reason for hiding this comment

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

lgtm

@MariaJose MariaJose merged commit cd22e6d into bigcommerce:main Jul 21, 2023
@MariaJose MariaJose deleted the APPEX-585 branch July 21, 2023 19:12
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