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

IUser interface does not have 'description' as property . But we get 'description' as property from the API #448

Open
2 tasks done
tushar1-000 opened this issue May 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tushar1-000
Copy link

tushar1-000 commented May 25, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Hi, I am creating a bug first time on GitHub so I can make some mistakes. But I want to contribute something. So below is what I found:

const { data } = await giphyFetch.gif(gifId[gifId?.length - 1]);
In data we have user and in user, we have different property

about_bio: string;
    description:string;
    display_name: string;
    user_type: 'partner' | 'artist' | 'user' | 'anonymous';
    is_public: boolean;
    primary_site?: string;
    twitter: string;
    facebook: string;
    instagram: string;
    tumblr_site: string;
    twitter_url?: string;
    facebook_url?: string;
    instagram_url?: string;
    tumblr_url?: string;
    website_url?: string;

But we get one more property description as a string from the JSON of the API. But as we don't have declared the property
description in the interface it shows the error.
image

Property 'description' does not exist on type 'IUser'

Expected behavior 🤔

There should be a property in the interface IUser. So we can use the description.

Steps to reproduce 🕹

Steps:

Screenshots or Videos 📹

No response

Platform 🌍

This can be seen in any platform. I tested in windows laptop and the browser is chrome.

GIPHY-JS SDK version

"@types/giphy-api": "^2.0.6",

TypeScript version

No response

Additional context 🔦

To solve this problem we can put description: string in the IUser interface and this can easily solve the above problem.

@tushar1-000 tushar1-000 added the bug Something isn't working label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant