forked from farhoodlabs/paperclip
Merge pull request #2542 from plind-dm/fix/heartbeat-context-attachments
fix(api): include attachment metadata in heartbeat-context response
This commit is contained in:
@@ -482,11 +482,12 @@ export function issueRoutes(
|
||||
? req.query.wakeCommentId.trim()
|
||||
: null;
|
||||
|
||||
const [{ project, goal }, ancestors, commentCursor, wakeComment] = await Promise.all([
|
||||
const [{ project, goal }, ancestors, commentCursor, wakeComment, attachments] = await Promise.all([
|
||||
resolveIssueProjectAndGoal(issue),
|
||||
svc.getAncestors(issue.id),
|
||||
svc.getCommentCursor(issue.id),
|
||||
wakeCommentId ? svc.getComment(wakeCommentId) : null,
|
||||
svc.listAttachments(issue.id),
|
||||
]);
|
||||
|
||||
res.json({
|
||||
@@ -533,6 +534,14 @@ export function issueRoutes(
|
||||
wakeComment && wakeComment.issueId === issue.id
|
||||
? wakeComment
|
||||
: null,
|
||||
attachments: attachments.map((a) => ({
|
||||
id: a.id,
|
||||
filename: a.originalFilename,
|
||||
contentType: a.contentType,
|
||||
byteSize: a.byteSize,
|
||||
contentPath: withContentPath(a).contentPath,
|
||||
createdAt: a.createdAt,
|
||||
})),
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user