Openstatus www.openstatus.dev

๐Ÿ› fix email data (#588)

authored by

Thibault Le Ouay and committed by
GitHub
ce20c327 37e71abf

+4 -4
+3 -3
packages/api/src/router/monitor.ts
··· 75 75 .returning() 76 76 .get(); 77 77 78 - if (Boolean(notifications.length)) { 78 + if (notifications.length > 0) { 79 79 // We should make sure the user has access to the notifications 80 80 const allNotifications = await opts.ctx.db.query.notification.findMany({ 81 81 where: inArray(notification.id, notifications), ··· 165 165 ?.includes(x), 166 166 ); 167 167 168 - if (Boolean(addedNotifications.length)) { 168 + if (addedNotifications.length > 0) { 169 169 const values = addedNotifications.map((notificationId) => ({ 170 170 monitorId: currentMonitor.id, 171 171 notificationId, ··· 178 178 .map(({ notificationId }) => notificationId) 179 179 .filter((x) => !notifications?.includes(x)); 180 180 181 - if (Boolean(removedNotifications.length)) { 181 + if (removedNotifications.length > 0) { 182 182 await opts.ctx.db 183 183 .delete(notificationsToMonitors) 184 184 .where(
+1 -1
packages/api/src/router/statusReport.ts
··· 131 131 await sendEmailHtml({ 132 132 to: subscribersEmails, 133 133 subject: `New status update for ${pageInfo.title}`, 134 - 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> 134 + 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> 135 135 `, 136 136 from: "Notification OpenStatus <notification@openstatus.dev>", 137 137 });