Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Bugfix - Favoriting a comment automatically associates(adds) a user with the comment. #46

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const CommentBox = observer<CommentBoxProps>(
favorite: this.favorite,
tags: this.tags,
text: this.text,
user: store.auth.userName!,
user: update ? '' : store.auth.userName!,
});
} else {
yield store.graphqlStore.mutateAddAnnotationToCommandGroup({
Expand Down
2 changes: 1 addition & 1 deletion applications/server/src/store/annotation-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class AnnotationResolvers {
const em = await connectToProjectEmOrFail(campaignId, ctx);
let annotation = await em.findOneOrFail<Annotation>(Annotation, annotationId);
const updatedTags = await Tag.createTags(em, tags ?? []);
annotation = em.assign(annotation, { user, text, favorite, tags: updatedTags });
annotation = em.assign(annotation, { user: user || annotation.user, text, favorite, tags: updatedTags });
await em.persistAndFlush(annotation);
ctx.cm.forkProject(campaignId);
return annotation;
Expand Down