Skip to content

Commit

Permalink
chore: 새 글 알림을 쏘기 위한 준비
Browse files Browse the repository at this point in the history
  • Loading branch information
potados99 committed Feb 14, 2022
1 parent cb82306 commit 240b7dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/service/EventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ type ModifyEventParams = {

class EventService {
async makeEvent(body: ModifyEventParams): Promise<Event> {
return await Event.create(body).save();
const {user} = body;
const event = await Event.create(body).save();

if (user.shallThisUserBeNotifiedWithThisEvent(event)) {
// TODO 알림서비스 호출
}

return event;
}

async getEvent(eventId: number): Promise<Event> {
Expand Down

0 comments on commit 240b7dc

Please sign in to comment.