You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getById<T extends 'me' | string>(
id: T
): T extends 'me' ? Observable<CurrentSanityUser> : Observable<SanityUser>
I am actually using this method by passing a string with several IDs separated with a comma, in this case the result looks like it should be typed with Observable<SanityUser[]> (it's an array).
Also, the current type of SanityUser includes a required isCurrentUser boolean property which is missing from my requests.
The text was updated successfully, but these errors were encountered:
thobas-dnvgl
changed the title
client.users.getById() types are too strict
client.users.getById() type is too strict
Jan 3, 2023
user.getById() types
feels too strict to me.Right not it looks like:
I am actually using this method by passing a string with several IDs separated with a comma, in this case the result looks like it should be typed with
Observable<SanityUser[]>
(it's an array).Also, the current type of
SanityUser
includes a requiredisCurrentUser
boolean property which is missing from my requests.The text was updated successfully, but these errors were encountered: