Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(web): use tuple destructuring for Drizzle update result

Richie McIlroya734be2299a8
diff --git a/apps/web/lib/Notification.ts b/apps/web/lib/Notification.ts
index 19279e972..b49e69a8a 100644
--- a/apps/web/lib/Notification.ts
+++ b/apps/web/lib/Notification.ts
@@ -340,7 +340,7 @@ export async function sendFirstViewEmail(
if (!params.isAnonymous && params.viewerUserId === videoWithOwner.ownerId)
return;
- const result = await database
+ const [result] = await database
.update(videos)
.set({ firstViewEmailSentAt: new Date() })
.where(
@@ -350,7 +350,7 @@ export async function sendFirstViewEmail(
),
);
- if (result[0].affectedRows === 0) return;
+ if (result.affectedRows === 0) return;
let viewerName: string;
if (params.isAnonymous) {