File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -246,9 +246,10 @@ export class JikeClient extends EventEmitter<EventMap> {
246
246
(
247
247
update
248
248
) : ( { actionTime : string } & PersonalUpdate ) | JikePostWithDetail => {
249
- // TODO repost
250
249
if ( update . type === 'ORIGINAL_POST' ) {
251
250
return this . getPost ( PostType . ORIGINAL , update . id , update )
251
+ } else if ( update . type === 'REPOST' ) {
252
+ return this . getPost ( PostType . REPOST , update . id , update )
252
253
} else {
253
254
return update
254
255
}
Original file line number Diff line number Diff line change 1
- import { PostType } from '../types/options'
2
1
import { isSuccess , throwRequestFailureError } from './utils/response'
3
2
import { fetchPaginated } from './utils/paginate'
3
+ import { rawTypeToEnum } from './utils/post'
4
4
import type { UserUnfollowOption } from '../types/options'
5
5
import type { PersonalPost , User } from '../types/entity'
6
6
import type { Users } from '../types/api-responses'
@@ -97,10 +97,9 @@ export class JikeUser<M extends boolean = boolean> {
97
97
option
98
98
)
99
99
100
- return updates . map ( ( update ) => {
101
- // TODO: repost
102
- return this . #client. getPost ( PostType . ORIGINAL , update . id , update )
103
- } )
100
+ return updates . map ( ( update ) =>
101
+ this . #client. getPost ( rawTypeToEnum ( update . type ) , update . id , update )
102
+ )
104
103
}
105
104
106
105
/**
Original file line number Diff line number Diff line change @@ -82,8 +82,16 @@ export interface OriginalPost {
82
82
liked ?: boolean
83
83
}
84
84
85
+ /**
86
+ * 转帖
87
+ */
88
+ export interface Repost {
89
+ type : 'REPOST'
90
+ [ key : string ] : any
91
+ }
92
+
85
93
/** 动态 */
86
- export type Post = OriginalPost /* | Repost */
94
+ export type Post = OriginalPost | Repost
87
95
88
96
/** 主页动态 */
89
97
export type PersonalPost = {
You can’t perform that action at this time.
0 commit comments