Feature/request manager remove get client usage (#325)

* Remove "getClient" usage from "metadata" util

* Remove "getClient" usage from "useRefreshManga" hook

* Remove "getClient" usage from "isDupChapter" util function

* Use correct endpoint for setting category metadata

"/meta" suffix was missing from url

* Use correct http method for updating manga metadata
This commit is contained in:
schroda
2023-06-04 00:50:58 +02:00
committed by GitHub
parent 207a87f3e9
commit 0fb204f141
4 changed files with 67 additions and 58 deletions

View File

@@ -29,11 +29,7 @@ import { useTranslation } from 'react-i18next';
import requestManager from 'lib/RequestManager';
const isDupChapter = async (chapterIndex: number, currentChapter: IChapter) => {
const nextChapter = (
await requestManager
.getClient()
.get<IChapter>(`/api/v1/manga/${currentChapter.mangaId}/chapter/${chapterIndex}`)
).data;
const nextChapter = await requestManager.getChapter(currentChapter.mangaId, chapterIndex).response;
return nextChapter.chapterNumber === currentChapter.chapterNumber;
};