From ff095c607f64e93f5f3ae67c90f586fb0b83b055 Mon Sep 17 00:00:00 2001 From: Szymon Potrzebowski <105052198+sormys@users.noreply.github.com> Date: Sat, 29 Apr 2023 20:36:26 +0200 Subject: [PATCH] Changed modifyGame request method to get (#37) --- src/routes/modifyGame.ts | 2 +- src/tests/modifyGame.test.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/modifyGame.ts b/src/routes/modifyGame.ts index ca42c26..c726406 100644 --- a/src/routes/modifyGame.ts +++ b/src/routes/modifyGame.ts @@ -6,7 +6,7 @@ import { sendFirebaseMessage, verifyFCMToken } from '../utils/firebase' import express, { type Router } from 'express' const router: Router = express.Router() -router.post( +router.get( '/modifyGame', rateLimiter, celebrate({ diff --git a/src/tests/modifyGame.test.ts b/src/tests/modifyGame.test.ts index 01fe73f..3c01eb1 100644 --- a/src/tests/modifyGame.test.ts +++ b/src/tests/modifyGame.test.ts @@ -10,20 +10,20 @@ test('Modify game, wrong args', async () => { await client .connect() .then(async () => { - await request(app).post('/modifyGame').expect(400) - await request(app).post('/modifyGame?creatorToken=2137').expect(400) + await request(app).get('/modifyGame').expect(400) + await request(app).get('/modifyGame?creatorToken=2137').expect(400) await client.query(insertGameCreator, [2137, '2137', 0]) - await request(app).post('/modifyGame?creatorToken=2137').expect(400) + await request(app).get('/modifyGame?creatorToken=2137').expect(400) await request(app) - .post('/modifyGame?creatorToken=2137&smallBlind=asd') + .get('/modifyGame?creatorToken=2137&smallBlind=asd') .expect(400) await request(app) - .post('/modifyGame?creatorToken=2137&startingFunnds=dasdasd') + .get('/modifyGame?creatorToken=2137&startingFunnds=dasdasd') .expect(400) await request(app) - .post('/modifyGame?creatorToken=2137&startingFunds=1&smallBlind=220') + .get('/modifyGame?creatorToken=2137&startingFunds=1&smallBlind=220') .expect(400) }) .finally(async () => { @@ -57,7 +57,7 @@ test('Modify game, correct arguments', async () => { .expect(200) await request(app) - .post( + .get( '/modifyGame?creatorToken=' .concat(gameMasterToken) .concat('&smallBlind=')