mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-04-19 14:53:20 +02:00
19 lines
665 B
TypeScript
19 lines
665 B
TypeScript
import {getData} from "../App";
|
|
import IChapter from "./interfaces/IChapter";
|
|
|
|
export default class ChapterFunctions {
|
|
|
|
static async GetChapterFromId(apiUri: string, chapterId: string): Promise<IChapter> {
|
|
if(chapterId === undefined || chapterId === null) {
|
|
console.error(`chapterId was not provided`);
|
|
return Promise.reject();
|
|
}
|
|
return getData(`${apiUri}/v2/Query/Chapter/${chapterId}`)
|
|
.then((json) => {
|
|
//console.info("Got all MangaFunctions");
|
|
const ret = json as IChapter;
|
|
//console.debug(ret);
|
|
return (ret);
|
|
});
|
|
}
|
|
} |