Skip to content

Conversation

@nhjbest22
Copy link
Contributor

Description

NotificationService의 함수들의 역할을 명확히하기 위해 JSDoc을 추가했습니다.

Additional context

추가적인 리팩토링을 진행하였습니다.

const notification = await this.prisma.notification.create({
data: {
title,
message,
url,
type
}
})
const notificationRecords = userIds.map((userId) => ({
notificationId: notification.id,
userId
}))
await this.prisma.notificationRecord.createMany({
data: notificationRecords
})

기존에는 위 코드와 같이 notification 엔티티를 생성한 후 notificationRecord 엔티티를 별도로 생성하도록 되어 있었습니다.
2번의 쿼리 호출이 비효율적인 것 같아 다음과 같이 1번의 쿼리 호출로 모든 엔티티가 생성되도록 변경하였습니다.

await this.prisma.notification.create({
data: {
title,
message,
url,
type,
NotificationRecord: {
createMany: {
data: userIds.map((userId) => ({ userId }))
}
}
}
})


Closes TAS-2446

Before submitting the PR, please make sure you do the following

@nhjbest22 nhjbest22 self-assigned this Jan 21, 2026
@github-project-automation github-project-automation bot moved this to Pending ✋ in Codedang Jan 21, 2026
@nhjbest22 nhjbest22 moved this from Pending ✋ to Review PLZ 🙏 in Codedang Jan 21, 2026
@skkuding-bot
Copy link

skkuding-bot bot commented Jan 21, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: bc5d83e786fd2a77b995edac84d9a4157c956df5
Health Status: Healthy

Open Preview | View in Argo CD

@notion-task-integration
Copy link

notion-task-integration bot commented Jan 21, 2026

@skkuding-bot
Copy link

skkuding-bot bot commented Jan 21, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: 70ed0bc4910a057e6cc20c1058021d1bc971eec4
Health Status: Healthy

Open Preview | View in Argo CD

@skkuding-bot
Copy link

skkuding-bot bot commented Jan 21, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: b3d7a94ca76a19342e9e1dcaa6819f590356a5a0
Health Status: Healthy

Open Preview | View in Argo CD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review PLZ 🙏

Development

Successfully merging this pull request may close these issues.

2 participants