Skip to content

Commit

Permalink
[object Object] fix (this has been an issue for ages)
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 23, 2023
1 parent 366fe84 commit 92764fa
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/v2/service/addon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,13 @@ export default class AddonService {
const url = `https://webapp.faithfulpack.net/#/review/addons?status=${now}&id=${String(a.id)}`;
if (now === "pending") {
title = `Add-on '${a.name}' pending approval`;
name += "update";
name += "Update";
} else {
const usernameApproval =
(a.approval.author
? await this.userService.getUserById(a.approval.author).catch(() => undefined)
: undefined) || "someone";
title = `Add-on '${a.name}' ${now} by ${usernameApproval}`;
name += "review";
const usernameApproval = (a.approval.author
? await this.userService.getUserById(a.approval.author).catch(() => undefined)
: undefined) || { username: "an unknown user" };
title = `Add-on '${a.name}' ${now} by ${usernameApproval.username}!`;
name += "Review";
}
const payload: RESTPostAPIChannelMessageJSONBody = {
embeds: [
Expand All @@ -626,7 +625,6 @@ export default class AddonService {
},
},
],
content: "",
};

await axios.post(process.env.WEBHOOK_URL, payload);
Expand Down

0 comments on commit 92764fa

Please sign in to comment.