a tool for shared writing and social publishing

publish notifications to db

+15
+15
app/lish/[did]/[publication]/[rkey]/Interactions/Comments/commentAction.ts
··· 65 65 } as unknown as Json, 66 66 }) 67 67 .select(); 68 + let notifications = [ 69 + { 70 + comment: uri.toString(), 71 + identity: new AtUri(args.document).host, 72 + reason: "reply-on-post", 73 + }, 74 + ]; 75 + if (args.comment.replyTo) 76 + notifications.push({ 77 + comment: uri.toString(), 78 + identity: new AtUri(args.comment.replyTo).host, 79 + reason: "reply-to-comment", 80 + }); 81 + // SOMEDAY: move this out the action with inngest or workflows 82 + await supabaseServerClient.from("notif_comments").insert(notifications); 68 83 69 84 return { 70 85 record: data?.[0].record as Json,