Api+App: komentarze usera - statusy przeczytania i typ USER_COMMENT (feed, profil, panel trenera)

This commit is contained in:
tisachi
2026-11-09 03:39:29 +01:00
parent 08e0c4080e
commit 7a9f438cc7
25 changed files with 801 additions and 88 deletions

View File

@@ -1094,6 +1094,11 @@ export function deleteComment(commentId: string, scope: 'me' | { userId: string
return api(path, { method: 'DELETE' });
}
/** Oznacza komentarze jako przeczytane per widz (wiersze CommentRead, idempotentne). */
export function markCommentsRead(commentIds: string[]) {
return api('/me/comments/read', { method: 'POST', body: { commentIds } });
}
// ---------- postępy per ćwiczenie ----------
export function useExerciseProgress() {
return useQuery({

View File

@@ -757,6 +757,8 @@ export interface ExerciseComment {
authorName: string;
body: string;
createdAt: string;
/** Stan przeczytania per widz (historia); brak pola w odpowiedzi utworzenia. */
read?: boolean;
}
export interface HistoryExercise {
@@ -890,7 +892,7 @@ export interface ConversationThread {
// ---------- aktualności (feed) ----------
export type NotificationType =
'PLAN_READY' | 'PLAN_EDITED' | 'PLAN_SHARED' | 'GYM_DELETED' | 'TRAINER_COMMENT';
'PLAN_READY' | 'PLAN_EDITED' | 'PLAN_SHARED' | 'GYM_DELETED' | 'TRAINER_COMMENT' | 'USER_COMMENT';
export interface FeedNotificationItem {
source: 'notification';