feat: add manga and shows collections

This commit is contained in:
2026-02-04 15:41:23 -08:00
parent e5b15e02de
commit 11be34cd21
21 changed files with 2518 additions and 24 deletions
@@ -62,4 +62,28 @@ export class CommentsService {
deleteCommentFromArt(artId: string, commentId: string): Observable<{ success: boolean }> {
return this.api.delete<{ success: boolean }>(`/art/${artId}/comments/${commentId}`);
}
getCommentsForShow(showId: string): Observable<Comment[]> {
return this.api.get<Comment[]>(`/shows/${showId}/comments`);
}
addCommentToShow(showId: string, comment: CreateCommentDto): Observable<Comment> {
return this.api.post<Comment>(`/shows/${showId}/comments`, comment);
}
deleteCommentFromShow(showId: string, commentId: string): Observable<{ success: boolean }> {
return this.api.delete<{ success: boolean }>(`/shows/${showId}/comments/${commentId}`);
}
getCommentsForManga(mangaId: string): Observable<Comment[]> {
return this.api.get<Comment[]>(`/manga/${mangaId}/comments`);
}
addCommentToManga(mangaId: string, comment: CreateCommentDto): Observable<Comment> {
return this.api.post<Comment>(`/manga/${mangaId}/comments`, comment);
}
deleteCommentFromManga(mangaId: string, commentId: string): Observable<{ success: boolean }> {
return this.api.delete<{ success: boolean }>(`/manga/${mangaId}/comments/${commentId}`);
}
}
@@ -0,0 +1,37 @@
/**
* @copyright 2026 NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ApiService } from './api.service';
import { Manga, CreateMangaDto, UpdateMangaDto } from '@library/shared-types';
@Injectable({
providedIn: 'root'
})
export class MangaService {
constructor(private api: ApiService) {}
getAllManga(): Observable<Manga[]> {
return this.api.get<Manga[]>('/manga');
}
getMangaById(id: string): Observable<Manga | null> {
return this.api.get<Manga | null>(`/manga/${id}`);
}
createManga(manga: CreateMangaDto): Observable<Manga> {
return this.api.post<Manga>('/manga', manga);
}
updateManga(id: string, manga: UpdateMangaDto): Observable<Manga> {
return this.api.put<Manga>(`/manga/${id}`, manga);
}
deleteManga(id: string): Observable<{ success: boolean }> {
return this.api.delete<{ success: boolean }>(`/manga/${id}`);
}
}
@@ -0,0 +1,37 @@
/**
* @copyright 2026 NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ApiService } from './api.service';
import { Show, CreateShowDto, UpdateShowDto } from '@library/shared-types';
@Injectable({
providedIn: 'root'
})
export class ShowsService {
constructor(private api: ApiService) {}
getAllShows(): Observable<Show[]> {
return this.api.get<Show[]>('/shows');
}
getShowById(id: string): Observable<Show | null> {
return this.api.get<Show | null>(`/shows/${id}`);
}
createShow(show: CreateShowDto): Observable<Show> {
return this.api.post<Show>('/shows', show);
}
updateShow(id: string, show: UpdateShowDto): Observable<Show> {
return this.api.put<Show>(`/shows/${id}`, show);
}
deleteShow(id: string): Observable<{ success: boolean }> {
return this.api.delete<{ success: boolean }>(`/shows/${id}`);
}
}