summaryrefslogtreecommitdiff
path: root/src/api/endpoints/othello
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/endpoints/othello')
-rw-r--r--src/api/endpoints/othello/games.ts2
-rw-r--r--src/api/endpoints/othello/match.ts1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/api/endpoints/othello/games.ts b/src/api/endpoints/othello/games.ts
index 62388b01d4..da85de1c1f 100644
--- a/src/api/endpoints/othello/games.ts
+++ b/src/api/endpoints/othello/games.ts
@@ -3,7 +3,7 @@ import Game, { pack } from '../../models/othello-game';
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'my' parameter
- const [my = false, myErr] = $(params.my).boolean().$;
+ const [my = false, myErr] = $(params.my).optional.boolean().$;
if (myErr) return rej('invalid my param');
const q = my ? {
diff --git a/src/api/endpoints/othello/match.ts b/src/api/endpoints/othello/match.ts
index 65243a5571..cb094bbc65 100644
--- a/src/api/endpoints/othello/match.ts
+++ b/src/api/endpoints/othello/match.ts
@@ -34,6 +34,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
black_user_id: parentIsBlack ? exist.parent_id : user._id,
white_user_id: parentIsBlack ? user._id : exist.parent_id,
turn_user_id: parentIsBlack ? exist.parent_id : user._id,
+ is_ended: false,
logs: []
});