admin dashboard fixed

maybe we need another design for this page
This commit is contained in:
dimitar committed 2026-02-16 20:42:11 +01:00
1 parent aa79eba06d
commit 71b1b549c3
5 files changed
+397 -455

No files matched your search

+22 -3
View File
@@ -73,6 +73,18 @@ export interface Article {
};
createdAt: string;
updatedAt: string;
isHero?: boolean;
isPinned?: boolean;
facebookShares?: number;
twitterShares?: number;
whatsappShares?: number;
telegramShares?: number;
ogTitle?: string;
ogDescription?: string;
ogImage?: string;
twitterTitle?: string;
twitterDescription?: string;
twitterImage?: string;
}
export interface ArticlesResponse {
@@ -126,6 +138,7 @@ export interface UpdateArticleDto {
videoUrl?: string;
videoPosition?: 'top' | 'inline' | 'bottom' | 'none';
videoCaption?: string;
isHero?: boolean;
}
export async function fetchArticles(params: FindArticlesParams = {}): Promise<ArticlesResponse> {
@@ -620,6 +633,7 @@ export interface FindCommentsParams {
articleId?: string;
liveBlogId?: string;
parentCommentId?: string;
parentId?: string;
page?: number;
limit?: number;
}
@@ -667,15 +681,20 @@ interface BackendComment {
// Recursive function to map comment and its replies
function mapBackendComment(comment: BackendComment): Comment {
const mappedComment: Comment = {
...comment,
id: comment.id,
content: comment.content,
articleId: comment.articleId,
liveBlogId: comment.liveBlogId,
parentCommentId: comment.parentId,
// Ensure reactions object exists
userId: comment.userId,
isVisible: comment.isVisible,
reactions: {
likes: comment.likeCount || 0,
dislikes: comment.dislikeCount || 0,
},
// Recursively map replies if they exist
replies: comment.replies?.map(mapBackendComment) || [],
createdAt: comment.createdAt,
updatedAt: comment.updatedAt,
};
return mappedComment;
}