Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

💡Feature Request: Consistent User Types #36

Closed
connormcmk opened this issue Oct 23, 2023 · 2 comments · Fixed by #37
Closed

💡Feature Request: Consistent User Types #36

connormcmk opened this issue Oct 23, 2023 · 2 comments · Fixed by #37
Labels
enhancement New feature or request

Comments

@connormcmk
Copy link

Cast.author has a bespoke definition, so the response from the getUser endpoint returns a different User type than the author field in the getCast endpoint, it would be easier to interface with if Cast.author was the same User definition as the standard User type

I.e. switch from:

export type Cast = {
  hash: Hash
  thread_hash: Hash | null
  parent_hash: Hash | null
  parent_url: string | null
  parent_author: {
    fid: number | null
  }
  author: {
    fid: number
    username: string
    display_name: string
    pfp_url: string
    profile: {
      bio: {
        text: string
      }
    }
    follower_count: number
    following_count: number
    verifications: Address[]
    active_status: 'active' | 'inactive'
  }
  text: string
  timestamp: string
  embeds: Embed[]
  reactions: {
    likes: Like[]
    recasts: Recast[]
  }
  replies: {
    count: number
  }
}

To

export type Cast = {
  hash: Hash
  thread_hash: Hash | null
  parent_hash: Hash | null
  parent_url: string | null
  parent_author: {
    fid: number | null
  }
  author: User
  text: string
  timestamp: string
  embeds: Embed[]
  reactions: {
    likes: Like[]
    recasts: Recast[]
  }
  replies: {
    count: number
  }
}
@alex-grover
Copy link
Owner

Released in v0.3.0!

@connormcmk
Copy link
Author

Yep, it works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants