Skip to content

Commit

Permalink
fix: remove unecessary join and site retrieval (#1268)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeg authored Apr 4, 2024
1 parent 3fe0734 commit a453b9f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/services/identity/NotificationsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,14 @@ class NotificationsService {
const recentTargetNotification = await this.repository.findOne({
where: {
user_id: siteMember.userId,
site_id: siteMember.siteId,
type: notificationType,
created_at: {
[Op.gte]: getNotificationExpiryDate(notificationType),
},
link,
source_username: notificationSourceUsername,
},
include: [
{
model: Site,
as: "site",
required: true,
where: {
id: siteMember.siteId,
},
},
],
})

if (recentTargetNotification) {
Expand Down

0 comments on commit a453b9f

Please sign in to comment.