diff --git a/backend/api/src/gameRoute.ts b/backend/api/src/gameRoute.ts index 2ac9175..0de3e2c 100644 --- a/backend/api/src/gameRoute.ts +++ b/backend/api/src/gameRoute.ts @@ -9,6 +9,9 @@ export const gameRoute = express.Router() gameRoute.use(express.json()) +/** + * Test + */ gameRoute.post( '/add', body('playtime') @@ -18,6 +21,8 @@ gameRoute.post( body('userId') .isInt({min: 1}) .custom(userWithIdExists), + body('score') + .isInt({min: 0}), /** * After processing the errors of express-validator, inserts the game into the DB * @param req diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 21f1ce3..a740596 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -4,12 +4,13 @@
- +
- + - +
@@ -24,7 +25,7 @@ @@ -74,7 +80,7 @@ export default defineComponent({ } .row { - margin-top:2em; + margin-top: 2em; } .everything { diff --git a/frontend/src/components/Game.vue b/frontend/src/components/Game.vue index c3f4a2d..de9b7f8 100644 --- a/frontend/src/components/Game.vue +++ b/frontend/src/components/Game.vue @@ -1,11 +1,53 @@ - \ No newline at end of file + diff --git a/frontend/src/components/Leaderboard.vue b/frontend/src/components/Leaderboard.vue index 97ebf7c..33d6ffc 100644 --- a/frontend/src/components/Leaderboard.vue +++ b/frontend/src/components/Leaderboard.vue @@ -19,6 +19,7 @@ import LeaderboardEntry from "@/components/LeaderboardEntry.vue"; import RRButton from "@/components/RRButton.vue"; +import App from "@/App.vue"; export default { name: "Leaderboard", @@ -44,7 +45,7 @@ export default { }, methods: { async fetchPage() { - let res = await fetch(`http://localhost:3000/leaderboard/${this.type}?pagination=true&entriesPerPage=${this.entriesPerPage}&page=${this.pageNumber}`, {method: "GET"}); + let res = await fetch(`${App.data().restUrl}/leaderboard/${this.type}?pagination=true&entriesPerPage=${this.entriesPerPage}&page=${this.pageNumber}`, {method: "GET"}); return await res.json(); }, title() {