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

Add others interface to pokemon sprites interface #586

Closed
athamov opened this issue Aug 13, 2022 · 5 comments
Closed

Add others interface to pokemon sprites interface #586

athamov opened this issue Aug 13, 2022 · 5 comments

Comments

@athamov
Copy link

athamov commented Aug 13, 2022

Describe the feature you'd like to request

I like using your lib for my pet project but I can't use other world images via sprites. in sprites interface there are not have any others sprites.Cause of that I add other type to Sprites interface

Describe the solution you'd like

Add some columns to sprites interface

Describe alternatives you've considered

add others?:[] to sprites interface

@Gabb-c
Copy link
Owner

Gabb-c commented Aug 15, 2022

Hey @athamov , thanks for your input!
Will be fixed soon in the next release.

Gabb-c added a commit that referenced this issue Aug 17, 2022
github-actions bot pushed a commit that referenced this issue Aug 17, 2022
## [1.16.1](v1.16.0...v1.16.1) (2022-08-17)

### Bug Fixes

* **models:** other pokemon sprites [#586](#586) ([3a53ea6](3a53ea6))
@Gabb-c
Copy link
Owner

Gabb-c commented Aug 17, 2022

Thanks @athamov for your contribution to Pokenode-ts!
Fixed in v1.16.1

@Gabb-c Gabb-c closed this as completed Aug 17, 2022
@DivoK
Copy link

DivoK commented Aug 26, 2022

Hey @Gabb-c, I think the typing you added is incorrect: while the other field is optional, its value is not an array but an object (like before this fix). Here's the output from the official API docs (can confirm its updated, I re-ran the query myself):

"sprites": {
    "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/35.png",
    "back_female": null,
    "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/35.png",
    "back_shiny_female": null,
    "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/35.png",
    "front_female": null,
    "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/35.png",
    "front_shiny_female": null,
    "other": {
        "dream_world": {
            "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/dream-world/35.svg",
            "front_female": null
        },
        "home": {
            "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/35.png",
            "front_female": null,
            "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/shiny/35.png",
            "front_shiny_female": null
        },
        "official-artwork": {
            "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/35.png"
        }
    },
    "versions": {
        ...
    }
},

I can issue a PR that removes the array notation ([]) if you'd like, but I assume it's best you'll double check that I'm not wrong myself 😄
Thanks for the awesome work btw!

@Gabb-c Gabb-c reopened this Aug 26, 2022
@Gabb-c
Copy link
Owner

Gabb-c commented Aug 26, 2022

@DivoK, I guess you're right. I checked with a few Pokemons.
Will revert the changes and release the fix.

@Gabb-c
Copy link
Owner

Gabb-c commented Aug 26, 2022

Fixed in 1.17.0

@Gabb-c Gabb-c closed this as completed Aug 26, 2022
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

No branches or pull requests

3 participants