import {
BlockCommunityResponse,
BlockPersonResponse,
+ CommentReportView,
CommentView,
CommunityBlockView,
CommunityView,
MyUserInfo,
PersonBlockView,
PersonViewSafe,
+ PostReportView,
PostView,
PrivateMessageView,
Search,
}
}
+export function updatePostReportRes(
+ data: PostReportView,
+ reports: PostReportView[]
+) {
+ let found = reports.find(p => p.post.id == data.post.id);
+ if (found) {
+ found.post_report = data.post_report;
+ }
+}
+
+export function updateCommentReportRes(
+ data: CommentReportView,
+ reports: CommentReportView[]
+) {
+ let found = reports.find(c => c.comment.id == data.comment.id);
+ if (found) {
+ found.comment_report = data.comment_report;
+ }
+}
+
export function commentsToFlatNodes(comments: CommentView[]): CommentNodeI[] {
let nodes: CommentNodeI[] = [];
for (let comment of comments) {