Skip to content

Commit 838c8fb

Browse files
committed
make the pkpass route POST instead of GET
1 parent fda1563 commit 838c8fb

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/api/routes/mobileWallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { getEntraIdToken, getUserProfile } from "../functions/entraId.js";
1212
import { checkPaidMembership } from "../functions/membership.js";
1313

1414
const mobileWalletRoute: FastifyPluginAsync = async (fastify, _options) => {
15-
fastify.get<{ Querystring: { email: string } }>(
15+
fastify.post<{ Querystring: { email: string } }>(
1616
"/membership",
1717
{
1818
schema: {

tests/live/mobileWallet.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ describe("Mobile pass issuance", async () => {
66
test("Test that passes will not be issued for non-members", async () => {
77
const response = await fetch(
88
`${baseEndpoint}/api/v1/mobileWallet/[email protected]`,
9+
{ method: "POST" },
910
);
1011
expect(response.status).toBe(403);
1112
});
1213
test("Test that passes will be issued for members", async () => {
1314
const response = await fetch(
1415
`${baseEndpoint}/api/v1/mobileWallet/[email protected]`,
16+
{ method: "POST" },
1517
);
1618
expect(response.status).toBe(202);
1719
});

tests/unit/mobileWallet.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ const app = await init();
5555
describe("Mobile wallet pass issuance", async () => {
5656
test("Test that passes will not be issued for non-emails", async () => {
5757
const response = await app.inject({
58-
method: "GET",
58+
method: "POST",
5959
url: "/api/v1/mobileWallet/membership?email=notanemail",
6060
});
6161
expect(response.statusCode).toBe(400);
6262
await response.json();
6363
});
6464
test("Test that passes will not be issued for non-members", async () => {
6565
const response = await app.inject({
66-
method: "GET",
66+
method: "POST",
6767
url: "/api/v1/mobileWallet/[email protected]",
6868
});
6969
expect(response.statusCode).toBe(403);
@@ -72,7 +72,7 @@ describe("Mobile wallet pass issuance", async () => {
7272
test("Test that passes will be issued for members", async () => {
7373
sesMock.on(SendRawEmailCommand).resolvesOnce({}).rejects();
7474
const response = await app.inject({
75-
method: "GET",
75+
method: "POST",
7676
url: "/api/v1/mobileWallet/[email protected]",
7777
});
7878
expect(response.statusCode).toBe(202);

0 commit comments

Comments
 (0)