diff --git a/src/api.ts b/src/api.ts index 89f6576..588d55e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -324,7 +324,7 @@ export class PicaComicAPI { categories?: string[] page?: number sort?: types.ComicSort - }): Promise { + }): Promise { return this.fetch .post('comics/advanced-search', { headers: makeAuthorizationHeaders(payload.token), @@ -335,7 +335,7 @@ export class PicaComicAPI { s: payload.sort || 'ua' } }) - .json>() + .json>() .then(res => res.data.comics) .catch(catchError) } diff --git a/src/type.ts b/src/type.ts index ef89389..2febc3e 100644 --- a/src/type.ts +++ b/src/type.ts @@ -53,6 +53,23 @@ export interface Comic { thumb: Image } +export interface SearchedComic { + _id: string + title: string + author?: string + totalViews: number + totalLikes: number + likesCount: number + finished: boolean + categories: string[] + thumb: Image + chineseTeam: string + description?: string + tags: string[] + updated_at: string + created_at: string +} + export interface Paginate { docs: T total: number @@ -63,6 +80,8 @@ export interface Paginate { export interface Comics extends Paginate {} +export interface SearchedComics extends Paginate {} + export interface Creator { _id: string name: string