Skip to content

Commit

Permalink
add: noti from sending the messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Celesca committed Nov 25, 2024
1 parent a90c713 commit f49f5be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/controllers/messageController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ export const messageController = new Elysia({ prefix: "/message" })
},
});

// Also send a notification to the receiver
await prisma.notification.create({
data: {
UserID: receiverID,
NotificationContent: "You have a new message from " + sender.UserName,
}});

return newMessage;


},
{
body: t.Object({
Expand Down

0 comments on commit f49f5be

Please sign in to comment.