Skip to content

Commit d5292b1

Browse files
committed
fix(jike-client): queryFollowersWithTime remove last empty object
1 parent 05657a0 commit d5292b1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/client/user.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,15 @@ export class JikeUser<M extends boolean = boolean> {
146146
if (!isSuccess(result)) throwRequestFailureError(result, '查询用户被关注')
147147

148148
const newKey = result.data.loadMoreKey?.createdAt
149-
const data: FollowerWithTime = {
150-
user: result.data.data[0],
151-
followTime: newKey,
152-
}
153-
return [newKey, [data]]
149+
const data: FollowerWithTime[] = result.data.data[0]
150+
? [
151+
{
152+
user: result.data.data[0],
153+
followTime: newKey,
154+
},
155+
]
156+
: []
157+
return [newKey, data]
154158
}
155159

156160
return fetchPaginated(

0 commit comments

Comments
 (0)