Skip to content

Commit

Permalink
remove redundant generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronny committed Feb 20, 2025
1 parent f4d1995 commit b204bf5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions web/src/engine/websites/LectorJPG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { DecoratableMangaScraper, Manga, type MangaPlugin } from '../providers/M
import * as Common from './decorators/Common';
import { FetchJSON } from '../platform/FetchProvider';

type APIResult<T> = {
response: T
}

type APIManga = {
name: string,
slug: string
type APIMangas = {
response: {
name: string,
slug: string
}[]
}

function ChapterExtractor(anchor: HTMLAnchorElement) {
Expand All @@ -36,7 +34,7 @@ export default class extends DecoratableMangaScraper {
}

public override async FetchMangas(provider: MangaPlugin): Promise<Manga[]> {
const { response } = await FetchJSON<APIResult<APIManga[]>>(new Request(new URL('./searchProject', this.apiUrl)));
const { response } = await FetchJSON<APIMangas>(new Request(new URL('./searchProject', this.apiUrl)));
return response.map(manga => new Manga(this, provider, `/ver/${manga.slug}`, manga.name));
}
}

0 comments on commit b204bf5

Please sign in to comment.