diff --git a/apps/frontend/src/app/components/art/art-gallery.component.ts b/apps/frontend/src/app/components/art/art-gallery.component.ts
index 3ce88d0..fbaefe0 100644
--- a/apps/frontend/src/app/components/art/art-gallery.component.ts
+++ b/apps/frontend/src/app/components/art/art-gallery.component.ts
@@ -14,12 +14,13 @@ import { SanitizeService } from '../../services/sanitize.service';
import { SuggestionService } from '../../services/suggestion.service';
import { PaginationComponent } from '../shared/pagination.component';
import { LikeButtonComponent } from '../shared/like-button.component';
+import { CommentDisplayComponent } from '../comment-display/comment-display.component';
import { Art, CreateArtDto, UpdateArtDto, Comment, SuggestionEntity, Link } from '@library/shared-types';
@Component({
selector: 'app-art-gallery',
standalone: true,
- imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent],
+ imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent, CommentDisplayComponent],
template: `
}
@@ -1982,4 +1942,21 @@ export class BooksListComponent implements OnInit {
alert('Failed to submit suggestion. Please try again.');
}
}
+
+ handleCommentEdit(bookId: string, event: { commentId: string; content: string }) {
+ this.commentsService.updateCommentOnBook(bookId, event.commentId, event.content).subscribe({
+ next: (updatedComment) => {
+ this.comments.set({
+ ...this.comments(),
+ [bookId]: (this.comments()[bookId] || []).map(c =>
+ c.id === event.commentId ? updatedComment : c
+ )
+ });
+ }
+ });
+ }
+
+ getCommentsSignal(bookId: string) {
+ return signal(this.comments()[bookId] || []);
+ }
}
\ No newline at end of file
diff --git a/apps/frontend/src/app/components/manga/manga-list.component.ts b/apps/frontend/src/app/components/manga/manga-list.component.ts
index 4030f30..58c9ecf 100644
--- a/apps/frontend/src/app/components/manga/manga-list.component.ts
+++ b/apps/frontend/src/app/components/manga/manga-list.component.ts
@@ -14,12 +14,13 @@ import { SanitizeService } from '../../services/sanitize.service';
import { SuggestionService } from '../../services/suggestion.service';
import { PaginationComponent } from '../shared/pagination.component';
import { LikeButtonComponent } from '../shared/like-button.component';
+import { CommentDisplayComponent } from '../comment-display/comment-display.component';
import { Manga, MangaStatus, CreateMangaDto, UpdateMangaDto, Comment, SuggestionEntity, Link } from '@library/shared-types';
@Component({
selector: 'app-manga-list',
standalone: true,
- imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent],
+ imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent, CommentDisplayComponent],
template: `
}
@@ -1780,4 +1736,21 @@ export class MangaListComponent implements OnInit {
alert('Failed to submit suggestion. Please try again.');
}
}
+
+ handleCommentEdit(mangaId: string, event: { commentId: string; content: string }) {
+ this.commentsService.updateCommentOnManga(mangaId, event.commentId, event.content).subscribe({
+ next: (updatedComment) => {
+ this.comments.set({
+ ...this.comments(),
+ [mangaId]: (this.comments()[mangaId] || []).map(c =>
+ c.id === event.commentId ? updatedComment : c
+ )
+ });
+ }
+ });
+ }
+
+ getCommentsSignal(mangaId: string) {
+ return signal(this.comments()[mangaId] || []);
+ }
}
diff --git a/apps/frontend/src/app/components/music/music-list.component.ts b/apps/frontend/src/app/components/music/music-list.component.ts
index a5ceeeb..1c91be4 100644
--- a/apps/frontend/src/app/components/music/music-list.component.ts
+++ b/apps/frontend/src/app/components/music/music-list.component.ts
@@ -14,12 +14,13 @@ import { SanitizeService } from '../../services/sanitize.service';
import { SuggestionService } from '../../services/suggestion.service';
import { PaginationComponent } from '../shared/pagination.component';
import { LikeButtonComponent } from '../shared/like-button.component';
+import { CommentDisplayComponent } from '../comment-display/comment-display.component';
import { Music, MusicStatus, MusicType, CreateMusicDto, UpdateMusicDto, Comment, SuggestionEntity, Link } from '@library/shared-types';
@Component({
selector: 'app-music-list',
standalone: true,
- imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent],
+ imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent, CommentDisplayComponent],
template: `
}
@@ -2014,4 +1970,21 @@ export class MusicListComponent implements OnInit {
alert('Failed to submit suggestion. Please try again.');
}
}
+
+ handleCommentEdit(musicId: string, event: { commentId: string; content: string }) {
+ this.commentsService.updateCommentOnMusic(musicId, event.commentId, event.content).subscribe({
+ next: (updatedComment) => {
+ this.comments.set({
+ ...this.comments(),
+ [musicId]: (this.comments()[musicId] || []).map(c =>
+ c.id === event.commentId ? updatedComment : c
+ )
+ });
+ }
+ });
+ }
+
+ getCommentsSignal(musicId: string) {
+ return signal(this.comments()[musicId] || []);
+ }
}
\ No newline at end of file
diff --git a/apps/frontend/src/app/components/shows/shows-list.component.ts b/apps/frontend/src/app/components/shows/shows-list.component.ts
index 1f6268e..ce41b07 100644
--- a/apps/frontend/src/app/components/shows/shows-list.component.ts
+++ b/apps/frontend/src/app/components/shows/shows-list.component.ts
@@ -14,12 +14,13 @@ import { SanitizeService } from '../../services/sanitize.service';
import { SuggestionService } from '../../services/suggestion.service';
import { PaginationComponent } from '../shared/pagination.component';
import { LikeButtonComponent } from '../shared/like-button.component';
+import { CommentDisplayComponent } from '../comment-display/comment-display.component';
import { Show, ShowStatus, ShowType, CreateShowDto, UpdateShowDto, Comment, SuggestionEntity, Link } from '@library/shared-types';
@Component({
selector: 'app-shows-list',
standalone: true,
- imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent],
+ imports: [CommonModule, FormsModule, PaginationComponent, LikeButtonComponent, CommentDisplayComponent],
template: `
}
@@ -1783,4 +1739,21 @@ export class ShowsListComponent implements OnInit {
alert('Failed to submit suggestion. Please try again.');
}
}
+
+ handleCommentEdit(showId: string, event: { commentId: string; content: string }) {
+ this.commentsService.updateCommentOnShow(showId, event.commentId, event.content).subscribe({
+ next: (updatedComment) => {
+ this.comments.set({
+ ...this.comments(),
+ [showId]: (this.comments()[showId] || []).map(c =>
+ c.id === event.commentId ? updatedComment : c
+ )
+ });
+ }
+ });
+ }
+
+ getCommentsSignal(showId: string) {
+ return signal(this.comments()[showId] || []);
+ }
}