Skip to content

Commit 9909895

Browse files
committed
fixed last few changes
1 parent b0cd893 commit 9909895

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/app/api/partnerDetails/[userId]/route.test.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ import { OrganizationType } from "@prisma/client";
66
import * as appHandler from "./route";
77

88
describe("POST /api/partnerDetails/[userId]", () => {
9-
beforeEach(() => {
10-
11-
});
12-
13-
//No Valid Session (401)
9+
// No Valid Session (401)
1410
test("returns 401 when there is no valid session", async () => {
1511
authMock.mockReturnValueOnce(null); //no valid session
1612

@@ -34,7 +30,7 @@ describe("POST /api/partnerDetails/[userId]", () => {
3430
});
3531
});
3632

37-
//PARTNER user tries to modify another user's details (session user ID does not match the request user ID) (403)
33+
// PARTNER user tries to modify another user's details (session user ID does not match the request user ID) (403)
3834
test("returns 403 when a PARTNER user tries to modify another user's record", async () => {
3935
authMock.mockReturnValueOnce({
4036
user: { id: "1", type: "PARTNER" },
@@ -61,7 +57,7 @@ describe("POST /api/partnerDetails/[userId]", () => {
6157
});
6258
});
6359

64-
//Invalid Form Data (400)
60+
// Invalid Form Data (400)
6561
test("returns 400 when the form data is invalid", async () => {
6662
authMock.mockReturnValueOnce({
6763
user: { id: "1", type: "SUPER_ADMIN" },
@@ -88,7 +84,7 @@ describe("POST /api/partnerDetails/[userId]", () => {
8884
});
8985
});
9086

91-
//Valid Request (200)
87+
// Valid Request (200)
9288
test("updates PartnerDetails and returns 200 for a valid request", async () => {
9389
authMock.mockReturnValueOnce({
9490
user: { id: "1", type: "SUPER_ADMIN" },

src/app/api/partnerDetails/[userId]/route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ export async function POST(
6666
},
6767
});
6868

69-
return NextResponse.json(updatedPartnerDetails, { status: 200 });
69+
return NextResponse.json(updatedPartnerDetails);
7070
}

0 commit comments

Comments
 (0)