Skip to content

Commit 256394e

Browse files
authored
Merge pull request #1394 from Northeastern-Electric-Racing/#1280-allow-allowed-expense-assignment-rr
#1280 Throws Error if expense type assigned to rr is not allowed
2 parents 953b1f6 + 130b7c2 commit 256394e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/backend/src/services/reimbursement-requests.services.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ export default class ReimbursementRequestService {
130130

131131
if (!expenseType) throw new NotFoundException('Expense Type', expenseTypeId);
132132

133+
if (!expenseType.allowed) throw new HttpException(400, `The expense type ${expenseType.name} is not allowed!`);
134+
133135
const validatedReimbursementProudcts = await validateReimbursementProducts(reimbursementProducts);
134136

135137
const createdReimbursementRequest = await prisma.reimbursement_Request.create({

0 commit comments

Comments
 (0)