Skip to content

Commit 5305404

Browse files
Sherin-2711i-am-that-guy
authored andcommitted
Status code fixes
1 parent 81c24ea commit 5305404

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/controllers/interview.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const updateInterviewById = async (req: Request, res: Response) => {
8282
}
8383

8484
if (existingInterview.memberId !== memberId) {
85-
throw new ApiError("You are not authorized to update this interview experience", 401);
85+
throw new ApiError("You are not authorized to update this interview experience", 403);
8686
}
8787

8888
const updatedInterview = await interviewService.updateInterviewById(interviewId, {
@@ -121,7 +121,7 @@ export const deleteInterviewById = async (req: Request, res: Response) => {
121121

122122

123123
if (existingInterview.memberId !== memberId) {
124-
throw new ApiError("You are not authorized to delete this interview", 401);
124+
throw new ApiError("You are not authorized to delete this interview", 403);
125125
}
126126

127127
await interviewService.deleteInterviewById(interviewId);

tests/Interview.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ describe('deleteInterviewById', () => {
381381
await expect(deleteInterviewById(req, res)).rejects.toThrow(ApiError);
382382
});
383383

384-
it('should throw 401 if memberId does not match', async () => {
384+
it('should throw 403 if memberId does not match', async () => {
385385
const req: any = {
386386
params: { id: '1' },
387387
body: { memberId: 'wrong_user' },

0 commit comments

Comments
 (0)