feat: ajout de la fonctionnalité d'édition des mangas, incluant la création d'un modal d'édition, la mise à jour de l'API pour gérer les modifications, et l'intégration de la logique de gestion des erreurs. Tests ajoutés pour valider le bon fonctionnement de l'édition.
This commit is contained in:
parent
896c57ac34
commit
9255509042
@@ -174,6 +174,25 @@ export class ApiMangaRepository {
|
||||
}
|
||||
}
|
||||
|
||||
async editManga(mangaId, updateData) {
|
||||
try {
|
||||
const response = await fetch(`/api/mangas/${mangaId}/edit`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(updateData)
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to edit manga');
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error('API Error:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async deleteChapter(chapterId) {
|
||||
try {
|
||||
const response = await fetch(`/api/manga/chapters/${chapterId}/cbz`, {
|
||||
|
||||
Reference in New Issue
Block a user