From 48e386deaa947465985d2fdf327a2d1422a40b04 Mon Sep 17 00:00:00 2001 From: Tine Jozelj Date: Tue, 17 Jul 2018 23:47:32 +0200 Subject: [PATCH] feat: add post to comment notifications; include post in notification response --- .../comment/events/handlers/create.handler.ts | 1 + src/modules/notification/notification.dto.ts | 5 ++-- .../notification/notification.repository.ts | 26 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/modules/comment/events/handlers/create.handler.ts b/src/modules/comment/events/handlers/create.handler.ts index 3137fc7c..7ee0ba11 100644 --- a/src/modules/comment/events/handlers/create.handler.ts +++ b/src/modules/comment/events/handlers/create.handler.ts @@ -35,6 +35,7 @@ export class CreateCommentEventHandler implements IEventHandler { .leftJoinAndSelect('notification.senderCorporation', 'senderCorporation') .leftJoinAndSelect('senderCorporation.alliance', 'senderCorporationAlliance') .leftJoinAndSelect('notification.senderAlliance', 'senderAlliance') + .leftJoinAndSelect('notification.post', 'post') + .leftJoinAndSelect('post.character', 'authorCharacter') + .leftJoinAndSelect('authorCharacter.corporation', 'authorCharacterCorporation') + .leftJoinAndSelect('authorCharacterCorporation.alliance', 'authorCharacterAlliance') + .leftJoinAndSelect('post.corporation', 'authorCorporation') + .leftJoinAndSelect('authorCorporation.alliance', 'authorCorporationAlliance') + .leftJoinAndSelect('post.alliance', 'authorAlliance') + .leftJoinAndSelect('post.characterWall', 'onCharacterWall') + .leftJoinAndSelect('onCharacterWall.corporation', 'onCharacterWallCorporation') + .leftJoinAndSelect('onCharacterWallCorporation.alliance', 'onCharacterWallAlliance') + .leftJoinAndSelect('post.corporationWall', 'onCorporationWall') + .leftJoinAndSelect('onCorporationWall.alliance', 'onCorporationWallAlliance') + .leftJoinAndSelect('post.allianceWall', 'onAllianceWall') + .leftJoinAndSelect('post.killmail', 'killmail') + .leftJoinAndSelect('post.hashtags', 'hashtag') + .leftJoinAndSelect('post.location', 'location') + .leftJoinAndSelect('killmail.participants', 'killmailP') + .leftJoinAndSelect('killmailP.character', 'killmailPCharacter') + .leftJoinAndSelect('killmailPCharacter.corporation', 'killmailPCorporation') + .leftJoinAndSelect('killmailPCorporation.alliance', 'killmailPAlliance') + .leftJoinAndSelect('killmailP.ship', 'killmailPShip') + .leftJoinAndSelect('killmailPShip.group', 'killmailPShipGroup') + .leftJoinAndSelect('killmailPShipGroup.category', 'killmailPShipGroupCategory') + .leftJoinAndSelect('killmailP.weapon', 'killmailPWeapon') + .leftJoinAndSelect('killmailPWeapon.group', 'killmailPWeaponGroup') + .leftJoinAndSelect('killmailPWeaponGroup.category', 'killmailPWeaponGroupCategory') .where('notification."recipientId" = :characterId', { characterId: character.id }) .orderBy({ 'notification."createdAt"': 'DESC' }) .offset(limit * page)