feat: page MangaDetails en vue.js
This commit is contained in:
parent
bee8572dc5
commit
41dc3c51aa
17
assets/vue/app/domain/manga/infrastructure/api/MangaApi.js
Normal file
17
assets/vue/app/domain/manga/infrastructure/api/MangaApi.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user