Skip to content

Commit

Permalink
Merge pull request #80 from Doarakko/topic/update-api-format
Browse files Browse the repository at this point in the history
fix format
  • Loading branch information
Doarakko committed Aug 21, 2024
2 parents 7882cea + 3e4ab91 commit a317d69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ async function run() {
return response.json();
})
.then((data) => {
if (!(Array.isArray(data) && data.length > 0)) {
if (!(('data' in data) && Array.isArray(data["data"]) && data["data"].length > 0)) {
throw new Error("Failed to get card");
}
const card = data[0];
const card = data["data"][0];
const cardName = card.name;
if (!(('card_images' in card) && Array.isArray(card.card_images) && card.card_images.length > 0)) {
throw new Error("Failed to get card images");
Expand Down

0 comments on commit a317d69

Please sign in to comment.