wip
This commit is contained in:
@@ -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 ? {
|
||||
|
||||
@@ -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: []
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user