Skip to content

Commit cd92ad5

Browse files
committed
Remove optional flag from Veto Reporter Email and add error handling in get-review-veto-by-review-id action
1 parent 25dbc6b commit cd92ad5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

components/etrusted/actions/create-veto-for-review/create-veto-for-review.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export default {
3434
type: "string",
3535
label: "Veto Reporter Email",
3636
description: "The E-Mail address of the veto reporter.",
37-
optional: true,
3837
},
3938
},
4039
async run({ $ }) {

components/etrusted/actions/get-review-veto-by-review-id/get-review-veto-by-review-id.mjs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ export default {
1616
},
1717
},
1818
async run({ $ }) {
19-
const response = await this.etrusted.getReviewVetoByReviewId({
20-
$,
21-
reviewId: this.reviewId,
22-
});
19+
try {
20+
const response = await this.etrusted.getReviewVetoByReviewId({
21+
$,
22+
reviewId: this.reviewId,
23+
});
2324

24-
$.export("$summary", `Successfully retrieved veto with ID ${response.id}`);
25-
return response;
25+
$.export("$summary", `Successfully retrieved veto with ID ${response.id}`);
26+
return response;
27+
} catch (error) {
28+
$.export("$summary", `Review with ID ${this.reviewId} has no veto`);
29+
return {};
30+
}
2631
},
2732
};

0 commit comments

Comments
 (0)