Skip to content

Commit

Permalink
Event rsvp notifications (#73)
Browse files Browse the repository at this point in the history
* rsvp notifications for event creator

* refactor
  • Loading branch information
gianlazz authored Jun 3, 2024
1 parent b31c204 commit cc9fe5d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/event/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ export class EventService {
});
userEvent.rsvp = rsvp;
await this.joinUserEventRepository.persistAndFlush(userEvent);

const user = await userEvent.user.load();
const event = await userEvent.event.load();
await this.notificationService.sendPushToUser(event.createdBy.id, {
title: `${(user.firstName || user.username)} RSVP'd ${rsvp} to ${event.name}.`,
body: `View the event.`,
click_action: `event/${eventId}`,
});

return userEvent;
}

Expand Down

0 comments on commit cc9fe5d

Please sign in to comment.