Skip to content

Commit

Permalink
Change File Name Automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee committed Jan 28, 2025
1 parent 8bb05fa commit b22fc7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/backend/src/services/reimbursement-requests.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ export default class ReimbursementRequestService {
throw new AccessDeniedGuestException('Guests cannot upload receipts');

const reimbursementRequest = await prisma.reimbursement_Request.findUnique({
where: { reimbursementRequestId }
where: { reimbursementRequestId },
include: { receiptPictures: true }
});

if (!reimbursementRequest) throw new NotFoundException('Reimbursement Request', reimbursementRequestId);
Expand All @@ -731,6 +732,7 @@ export default class ReimbursementRequestService {
);
}

file.filename = 'receipt ' + reimbursementRequest.receiptPictures.length;
const imageData = await uploadFile(file);

if (!imageData?.name) {
Expand Down

0 comments on commit b22fc7d

Please sign in to comment.