fetch labels

This commit is contained in:
hmacr committed 2025-04-23 12:43:32 +05:30
1 parent ac46d736a0
commit 9fc60d0f04
1 file changed
+11 -4
+11 -4
View File
@@ -84,10 +84,14 @@ export class Linear {
return { error: "Resource not found" };
}
const [author, state] = await Promise.all([issue.creator, issue.state]);
const [author, state, labels] = await Promise.all([
issue.creator,
issue.state,
issue.paginate(issue.labels, {}),
]);
if (!author || !state) {
return { error: "Resource not found" };
if (!author || !state || !labels) {
return { error: "Failed to fetch auxiliary data from Linear" };
}
return {
@@ -100,7 +104,10 @@ export class Linear {
name: author.name,
avatarUrl: author.avatarUrl ?? "",
},
labels: [],
labels: labels.map((label) => ({
name: label.name,
color: label.color,
})),
state: {
name: state.name,
color: state.color,