Files
grimmory/frontend/src/app/shared/service/pdf-annotation.service.ts
T
James Cox 874b013f75 refactor(frontend): rename booklore-ui to frontend
- Frontend path:
  - rename the tracked Angular app tree from `booklore-ui/` to `frontend/`
  - preserve file contents during the move so this commit stays focused on the path change itself
- Frontend docs:
  - update the moved frontend README and contribution guide where they refer to the renamed folder
  - keep those edits limited to path references introduced by the directory rename
2026-04-22 17:26:39 -04:00

26 lines
800 B
TypeScript

import {Injectable, inject} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import {API_CONFIG} from '../../core/config/api-config';
@Injectable({
providedIn: 'root'
})
export class PdfAnnotationService {
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/pdf-annotations`;
private readonly http = inject(HttpClient);
getAnnotations(bookId: number): Observable<{ data: string }> {
return this.http.get<{ data: string }>(`${this.url}/book/${bookId}`);
}
saveAnnotations(bookId: number, data: string): Observable<void> {
return this.http.put<void>(`${this.url}/book/${bookId}`, {data});
}
deleteAnnotations(bookId: number): Observable<void> {
return this.http.delete<void>(`${this.url}/book/${bookId}`);
}
}