Skip to content

Commit d3ba13d

Browse files
committed
#3943 refine prisma q and future proof description check
1 parent 10576fc commit d3ba13d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/backend/src/utils/slack.utils.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,16 @@ export const sendReimbursementRequestCreatedNotificationAndCreateMessageInfo = a
141141

142142
const reimbursementRequest = await prisma.reimbursement_Request.findUnique({
143143
where: { reimbursementRequestId: requestId },
144-
...getReimbursementRequestQueryArgs(organizationId)
144+
select: {
145+
identifier: true,
146+
totalCost: true,
147+
description: true,
148+
vendor: {
149+
select: {
150+
name: true
151+
}
152+
}
153+
}
145154
});
146155

147156
if (!reimbursementRequest) throw new HttpException(500, 'Reimbursement request does not exist!');
@@ -173,7 +182,7 @@ export const sendReimbursementRequestCreatedNotificationAndCreateMessageInfo = a
173182
const { messageInfoId, channelId, timestamp } = createdMessageInfo;
174183

175184
// send reimbursement request description in slack thread
176-
if (description !== '') {
185+
if (description) {
177186
await sendThreadResponse(
178187
[{ messageInfoId, channelId, timestamp, changeRequestId: null }],
179188
`Description: ${description}`

0 commit comments

Comments
 (0)