From 0bca0e8a02e005293663abc4a052ad8f8b2078f3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 7 Mar 2018 18:45:16 +0900 Subject: wip --- src/api/endpoints/othello/games.ts | 2 +- src/api/endpoints/othello/match.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/api/endpoints/othello') 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: [] }); -- cgit v1.2.3-freya