Skip to content

Commit 377e76a

Browse files
committed
refactor: update subject tests. extract common user logic
1 parent eebd0fa commit 377e76a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/utils/subject.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,9 @@ async function getLatestCommentUser(
203203
notification: Notification,
204204
token: string,
205205
): Promise<User> {
206-
const response: IssueComments | ReleaseComments = (
206+
const response: IssueComments = (
207207
await apiRequestAuth(notification.subject.latest_comment_url, 'GET', token)
208208
).data;
209209

210-
return (
211-
(response as IssueComments).user ?? (response as ReleaseComments).author
212-
);
210+
return response.user;
213211
}

0 commit comments

Comments
 (0)