chore: issue reaction response updated (#3951)

This commit is contained in:
Anmol Singh Bhatia 2024-03-15 17:26:38 +05:30 committed by GitHub
parent d25fcfdd88
commit cbe5d9a047
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
export type TIssueReaction = {
actor_id: string;
actor: string;
id: string;
issue_id: string;
issue: string;
reaction: string;
};

View File

@ -79,7 +79,7 @@ export const IssueReaction: FC<TIssueReaction> = observer((props) => {
const reactionUsers = (reactionIds?.[reaction] || [])
.map((reactionId) => {
const reactionDetails = getReactionById(reactionId);
return reactionDetails ? getUserDetails(reactionDetails.actor_id)?.display_name : null;
return reactionDetails ? getUserDetails(reactionDetails.actor)?.display_name : null;
})
.filter((displayName): displayName is string => !!displayName);

View File

@ -84,7 +84,7 @@ export class IssueReactionStore implements IIssueReactionStore {
if (reactions?.[reaction])
reactions?.[reaction].map((reactionId) => {
const currentReaction = this.getReactionById(reactionId);
if (currentReaction && currentReaction.actor_id === userId) _userReactions.push(currentReaction);
if (currentReaction && currentReaction.actor === userId) _userReactions.push(currentReaction);
});
});
@ -151,7 +151,7 @@ export class IssueReactionStore implements IIssueReactionStore {
) => {
try {
const userReactions = this.reactionsByUser(issueId, userId);
const currentReaction = find(userReactions, { actor_id: userId, reaction: reaction });
const currentReaction = find(userReactions, { actor: userId, reaction: reaction });
if (currentReaction && currentReaction.id) {
runInAction(() => {