/** * @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 { Art, CreateArtDto, UpdateArtDto } from '@library/shared-types'; @Injectable({ providedIn: 'root' }) export class ArtService { constructor(private api: ApiService) {} getAllArt(): Observable { return this.api.get('/art'); } getArtById(id: string): Observable { return this.api.get(`/art/${id}`); } createArt(art: CreateArtDto): Observable { return this.api.post('/art', art); } updateArt(id: string, art: UpdateArtDto): Observable { return this.api.put(`/art/${id}`, art); } deleteArt(id: string): Observable<{ success: boolean }> { return this.api.delete<{ success: boolean }>(`/art/${id}`); } }