Skip to content

Open-source status page, incident response and uptime monitoring

🐛 fix email data (#588)

Thibault Le Ouayce20c32716b5
diff --git a/packages/api/src/router/monitor.ts b/packages/api/src/router/monitor.ts
index 764c8cd4e..20a245c82 100644
--- a/packages/api/src/router/monitor.ts
+++ b/packages/api/src/router/monitor.ts
@@ -75,7 +75,7 @@ export const monitorRouter = createTRPCRouter({
.returning()
.get();
- if (Boolean(notifications.length)) {
+ if (notifications.length > 0) {
// We should make sure the user has access to the notifications
const allNotifications = await opts.ctx.db.query.notification.findMany({
where: inArray(notification.id, notifications),
@@ -165,7 +165,7 @@ export const monitorRouter = createTRPCRouter({
?.includes(x),
);
- if (Boolean(addedNotifications.length)) {
+ if (addedNotifications.length > 0) {
const values = addedNotifications.map((notificationId) => ({
monitorId: currentMonitor.id,
notificationId,
@@ -178,7 +178,7 @@ export const monitorRouter = createTRPCRouter({
.map(({ notificationId }) => notificationId)
.filter((x) => !notifications?.includes(x));
- if (Boolean(removedNotifications.length)) {
+ if (removedNotifications.length > 0) {
await opts.ctx.db
.delete(notificationsToMonitors)
.where(
diff --git a/packages/api/src/router/statusReport.ts b/packages/api/src/router/statusReport.ts
index 9b43f0136..ae482ca82 100644
--- a/packages/api/src/router/statusReport.ts
+++ b/packages/api/src/router/statusReport.ts
@@ -131,7 +131,7 @@ export const statusReportRouter = createTRPCRouter({
await sendEmailHtml({
to: subscribersEmails,
subject: `New status update for ${pageInfo.title}`,
- html: `<p>Hi,</p><p>${pageInfo.title} just posted an update on their status page:</p><p>New Status : ${statusReportUpdate.status}</p><p>${statusReportUpdate.message}</p></p><p></p><p>Powered by OpenStatus</p><p></p><p></p><p></p><p></p><p></p>
+ html: `<p>Hi,</p><p>${pageInfo.title} just posted an update on their status page:</p><p>New Status : ${updatedValue.status}</p><p>${updatedValue.message}</p></p><p></p><p>Powered by OpenStatus</p><p></p><p></p><p></p><p></p><p></p>
`,
from: "Notification OpenStatus <[email protected]>",
});