Update dependencies 🚀
This commit is contained in:
@@ -3,19 +3,19 @@ import OthelloGame, { pack } from '../../../../models/othello-game';
|
||||
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'my' parameter
|
||||
const [my = false, myErr] = $(params.my).optional.boolean().$;
|
||||
const [my = false, myErr] = $(params.my).optional.boolean().get();
|
||||
if (myErr) return rej('invalid my param');
|
||||
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$;
|
||||
const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).get();
|
||||
if (limitErr) return rej('invalid limit param');
|
||||
|
||||
// Get 'sinceId' parameter
|
||||
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).$;
|
||||
const [sinceId, sinceIdErr] = $(params.sinceId).optional.type(ID).get();
|
||||
if (sinceIdErr) return rej('invalid sinceId param');
|
||||
|
||||
// Get 'untilId' parameter
|
||||
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).$;
|
||||
const [untilId, untilIdErr] = $(params.untilId).optional.type(ID).get();
|
||||
if (untilIdErr) return rej('invalid untilId param');
|
||||
|
||||
// Check if both of sinceId and untilId is specified
|
||||
|
@@ -4,7 +4,7 @@ import Othello from '../../../../../othello/core';
|
||||
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'gameId' parameter
|
||||
const [gameId, gameIdErr] = $(params.gameId).type(ID).$;
|
||||
const [gameId, gameIdErr] = $(params.gameId).type(ID).get();
|
||||
if (gameIdErr) return rej('invalid gameId param');
|
||||
|
||||
const game = await OthelloGame.findOne({ _id: gameId });
|
||||
|
@@ -7,7 +7,7 @@ import { eighteight } from '../../../../othello/maps';
|
||||
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [childId, childIdErr] = $(params.userId).type(ID).$;
|
||||
const [childId, childIdErr] = $(params.userId).type(ID).get();
|
||||
if (childIdErr) return rej('invalid userId param');
|
||||
|
||||
// Myself
|
||||
|
Reference in New Issue
Block a user