Fix posts/tweets being undefined

This commit is contained in:
dangered wolf 2023-11-03 01:56:11 -04:00
parent 1d3f4584d1
commit fecac910b8
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -10,8 +10,7 @@ export const convertToApiUser = (user: GraphQLUser): APIUser => {
apiUser.followers = user.legacy.followers_count;
apiUser.following = user.legacy.friends_count;
apiUser.likes = user.legacy.favourites_count;
// @ts-expect-error `tweets` is only part of legacy API
apiUser.tweets = user.legacy.statuses_count;
apiUser.posts = user.legacy.statuses_count;
apiUser.name = user.legacy.name;
apiUser.screen_name = user.legacy.screen_name;
apiUser.global_screen_name = `${user.legacy.screen_name}@${Constants.TWITTER_GLOBAL_NAME_ROOT}`;