Files
Mangarr/assets/vue/app/domain/manga/infrastructure/api/MangaApi.js
ext.jeremy.guillot@maxicoffee.domains 41dc3c51aa feat: page MangaDetails en vue.js
2025-03-24 18:01:24 +01:00

17 lines
521 B
JavaScript

export class MangaApi {
static async fetchById(mangaId) {
const response = await fetch(`/api/mangas/${mangaId}`);
if (!response.ok) {
throw new Error('Failed to fetch manga details');
}
return response.json();
}
static async fetchChapters(mangaId) {
const response = await fetch(`/api/mangas/${mangaId}/chapters`);
if (!response.ok) {
throw new Error('Failed to fetch manga chapters');
}
return response.json();
}
}