Skip to content

Commit

Permalink
Remove attendee from event when removing attendee form team
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienDuf committed Apr 4, 2019
1 parent fc7ea3b commit c53d164
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/modules/database/teams/teams.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,15 @@ export class TeamsService extends BaseService<Teams, CreateTeamDto> {
attendees: attendeeId
}
}).exec();

await this.eventsModel.updateOne({
_id: eventId
}, {
$pull: {
attendees: {
attendee: attendeeId
}
}
});
}
}

0 comments on commit c53d164

Please sign in to comment.