Skip to content

Commit

Permalink
fix: fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
georgimld committed Jan 27, 2025
1 parent 1021715 commit a5e6ca1
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 14 deletions.
8 changes: 0 additions & 8 deletions app/components/newsPage/cards/NewsCollabCommentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ export function useNewsCollabCommentCard(props: NewsCollabCommentCardProps) {
const item = entry.item as CollaborationComment;
const question = item.question;

if (!question) {
errorMessage({ message: m.components_collaboration_comments_collaborationCommentCard_questionMissing() });
appInsights.trackException({
exception: new Error('Failed to get collaboration question'),
severityLevel: SeverityLevel.Error,
});
}

const [comment, setComment] = useState(item);

const state = useEditingState();
Expand Down
2 changes: 0 additions & 2 deletions app/services/collaborationCommentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
addCommentToDb,
deleteCommentInDb,
getCommentById,
getCommentLikes,
getCommentResponseCount,
handleCommentLike,
updateCommentInDb,
Expand Down Expand Up @@ -189,7 +188,6 @@ export const createNewsFeedEntryForComment = async (comment: Comment, user?: Use

const author = user ?? comment.author;
const commentCount = (await getCommentResponseCount(dbClient, comment.id)) || 0;
const likedBy = await getCommentLikes(dbClient, comment.id); //todo
const reactions = await getReactionsForEntity(dbClient, ObjectType.COLLABORATION_COMMENT, comment.id);
const followerIds = await getFollowedByForEntity(dbClient, ObjectType.PROJECT, question.projectId);
const followers = await mapToRedisUsers(followerIds);
Expand Down
4 changes: 2 additions & 2 deletions app/services/commentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ export const removeComment = async ({ user, commentId }: RemoveComment) => {

const updateCommentInCache = async (comment: { objectId: string; objectType: ObjectType }, author: UserSession) => {
const commentCount = await countComments(dbClient, comment.objectId);
const body = { id: comment.objectId, responseCount: commentCount };
const body = { id: comment.objectId, commentCount };
return comment.objectType === 'POST'
? await updatePostInCache({ post: body, user: author })
: await updateProjectUpdateInCache({ update: body });
};

const removeCommentInCache = async (comment: { objectId: string; objectType: ObjectType }, author: UserSession) => {
const commentCount = await countComments(dbClient, comment.objectId);
const body = { id: comment.objectId, responseCount: commentCount };
const body = { id: comment.objectId, commentCount };
return comment.objectType === 'POST'
? await updatePostInCache({ post: body, user: author })
: await updateProjectUpdateInCache({ update: body });
Expand Down
1 change: 0 additions & 1 deletion app/services/updateService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use server';

import { ObjectType, ProjectUpdate } from '@/common/types';
import { countComments } from '@/repository/db/comment';
import { getFollowedByForEntity } from '@/repository/db/follow';
import dbClient from '@/repository/db/prisma/prisma';
import { getReactionsForEntity } from '@/repository/db/reaction';
Expand Down
2 changes: 1 addition & 1 deletion app/utils/newsFeed/newsFeedSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { getBasicCollaborationQuestionStartingFromWithAdditionalData } from '@/u
import { getProjectsStartingFrom } from '@/utils/requests/project/requests';

import { mapToComment } from '../requests/comments/mapping';
import { saveEntryNewsComments } from '../requests/comments/requests';
import { getEventsStartingFrom } from '../requests/events/requests';
import { getSurveyQuestionsStartingFrom } from '../requests/surveyQuestions/requests';
import { getProjectUpdatesStartingFrom } from '../requests/updates/requests';
Expand All @@ -33,7 +34,6 @@ import {
transactionalDeleteItemsFromRedis,
transactionalSaveNewsFeedEntry,
} from './redis/redisService';
import { saveEntryNewsComments } from '../requests/comments/requests';

const logger = getLogger();
const maxSyncRetries = 3;
Expand Down

0 comments on commit a5e6ca1

Please sign in to comment.