Skip to content

Commit

Permalink
feat: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
NithinKuruba committed Dec 18, 2023
1 parent 1fa2e2b commit c060c77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app/pages/api/realms/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
details: getUpdatedProperties(currentRequest, updatedRealm),
});
updatedRealm = !isAdmin ? omit(updatedRealm, adminOnlyFields) : updatedRealm;

sendUpdateEmail(updatedRealm, session, updatingApprovalStatus).catch((err) =>
console.error(`Error sending email for ${updatedRealm.realm}`, err),
);
sendReadyToUseEmail(updatedRealm).catch((err) =>
console.error(`Error sending email for ${updatedRealm.realm}`, err),
);

return res.send(updatedRealm);
} catch (err) {
await createEvent({
Expand Down
4 changes: 1 addition & 3 deletions app/pages/api/realms/pending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}
},
);
sendReadyToUseEmail(currentRequest!).catch((err) =>
console.error(`Error sending email for ${currentRequest?.realm}`, err),
);
await sendReadyToUseEmail(currentRequest!);
} catch (err) {
console.trace(err);
console.error(err);
Expand Down

0 comments on commit c060c77

Please sign in to comment.