Skip to content

Commit 8c42cc8

Browse files
committed
#1658 Changed error messages
1 parent 20fad75 commit 8c42cc8

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ export default class ReimbursementRequestService {
259259
await validateUserIsPartOfFinanceTeam(submitter);
260260
} catch {
261261
if (oldReimbursementRequest.recipientId !== submitter.userId)
262-
throw new AccessDeniedException('You do not have access to edit this reimbursement request');
262+
throw new AccessDeniedException(
263+
'You do not have access to edit this reimbursement request, only the creator or finance team can edit a reimbursement request'
264+
);
263265
}
264266

265267
const vendor = await prisma.vendor.findUnique({

src/backend/tests/reimbursement-requests.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ describe('Reimbursement Requests', () => {
222222
[],
223223
superman
224224
)
225-
).rejects.toThrow(new AccessDeniedException('You do not have access to edit this reimbursement request'));
225+
).rejects.toThrow(
226+
new AccessDeniedException(
227+
'You do not have access to edit this reimbursement request, only the creator or finance team can edit a reimbursement request'
228+
)
229+
);
226230
});
227231

228232
test('Edit Reimbursement Request fails if Submitter not on Finance Team', async () => {
@@ -239,7 +243,11 @@ describe('Reimbursement Requests', () => {
239243
[],
240244
alfred
241245
)
242-
).rejects.toThrow(new AccessDeniedException('You do not have access to edit this reimbursement request'));
246+
).rejects.toThrow(
247+
new AccessDeniedException(
248+
'You do not have access to edit this reimbursement request, only the creator or finance team can edit a reimbursement request'
249+
)
250+
);
243251
});
244252

245253
test('Edit Reimbursement Request Fails When Vendor does not exist', async () => {

0 commit comments

Comments
 (0)