|
1 | 1 | import axios, { isAxiosError } from '@/server/services/axios' |
2 | 2 | import { WEB_SCRAPER_TOKEN } from '@/config/bff.yargs' |
| 3 | +import { UNDEFINED } from '/@/constants/value' |
3 | 4 | import { isNodeDev } from '@/server/environment' |
4 | 5 | import type { TwitterTweet, TwitterProfile, TwitterAggregate } from './index' |
5 | 6 |
|
@@ -129,11 +130,11 @@ export const getSotweTwitterAggregate = async (twitterUsername: string): Promise |
129 | 130 | id: sotwe?.info?.id, |
130 | 131 | name: sotwe?.info?.name || twitterUsername, |
131 | 132 | avatar: sotwe?.info?.profileImageOriginal || '', |
132 | | - description: sotwe?.info.description || void 0, |
133 | | - location: sotwe?.info.location || void 0, |
134 | | - tweetCount: sotwe?.info.postCount ?? void 0, |
135 | | - followerCount: sotwe?.info.followerCount ?? void 0, |
136 | | - followingCount: sotwe?.info.followingCount ?? void 0 |
| 133 | + description: sotwe?.info.description || UNDEFINED, |
| 134 | + location: sotwe?.info.location || UNDEFINED, |
| 135 | + tweetCount: sotwe?.info.postCount ?? UNDEFINED, |
| 136 | + followerCount: sotwe?.info.followerCount ?? UNDEFINED, |
| 137 | + followingCount: sotwe?.info.followingCount ?? UNDEFINED |
137 | 138 | } |
138 | 139 |
|
139 | 140 | // sotwe all tweets |
@@ -167,9 +168,9 @@ export const getSotweTwitterAggregate = async (twitterUsername: string): Promise |
167 | 168 | text: improveSotweTweet(tweet), |
168 | 169 | html: improveSotweTweet(tweet), |
169 | 170 | date: tweet.createdAt, |
170 | | - location: tweet.location?.name || void 0, |
171 | | - favoriteCount: tweet.favoriteCount ?? void 0, |
172 | | - retweetCount: tweet.retweetCount ?? void 0, |
| 171 | + location: tweet.location?.name || UNDEFINED, |
| 172 | + favoriteCount: tweet.favoriteCount ?? UNDEFINED, |
| 173 | + retweetCount: tweet.retweetCount ?? UNDEFINED, |
173 | 174 | mediaCount: tweet.mediaEntities?.length ?? 0, |
174 | 175 | isReply: !!tweet.inReplyToUserId, |
175 | 176 | isQuote: !!tweet.quotedStatus, |
|
0 commit comments