summaryrefslogtreecommitdiff
path: root/src/api/endpoints
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-28 13:32:05 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-28 13:32:05 +0900
commit69cef75b53671ccd7e0a199d31fa2d6d7c91fe78 (patch)
tree80441ef9023587db260b6db726e6c833f43e02b8 /src/api/endpoints
parentwip (diff)
downloadsharkey-69cef75b53671ccd7e0a199d31fa2d6d7c91fe78.tar.gz
sharkey-69cef75b53671ccd7e0a199d31fa2d6d7c91fe78.tar.bz2
sharkey-69cef75b53671ccd7e0a199d31fa2d6d7c91fe78.zip
wip
Diffstat (limited to 'src/api/endpoints')
-rw-r--r--src/api/endpoints/othello/games.ts4
-rw-r--r--src/api/endpoints/othello/games/show.ts4
-rw-r--r--src/api/endpoints/othello/match.ts4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/api/endpoints/othello/games.ts b/src/api/endpoints/othello/games.ts
index 2a6bbb4043..f6e38b8d87 100644
--- a/src/api/endpoints/othello/games.ts
+++ b/src/api/endpoints/othello/games.ts
@@ -1,5 +1,5 @@
import $ from 'cafy';
-import Game, { pack } from '../../models/othello-game';
+import OthelloGame, { pack } from '../../models/othello-game';
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'my' parameter
@@ -50,7 +50,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
}
// Fetch games
- const games = await Game.find(q, {
+ const games = await OthelloGame.find(q, {
sort,
limit
});
diff --git a/src/api/endpoints/othello/games/show.ts b/src/api/endpoints/othello/games/show.ts
index 2b0db4dd00..c7bd74a39a 100644
--- a/src/api/endpoints/othello/games/show.ts
+++ b/src/api/endpoints/othello/games/show.ts
@@ -1,5 +1,5 @@
import $ from 'cafy';
-import Game, { pack } from '../../../models/othello-game';
+import OthelloGame, { pack } from '../../../models/othello-game';
import Othello from '../../../../common/othello/core';
module.exports = (params, user) => new Promise(async (res, rej) => {
@@ -7,7 +7,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
const [gameId, gameIdErr] = $(params.game_id).id().$;
if (gameIdErr) return rej('invalid game_id param');
- const game = await Game.findOne({ _id: gameId });
+ const game = await OthelloGame.findOne({ _id: gameId });
if (game == null) {
return rej('game not found');
diff --git a/src/api/endpoints/othello/match.ts b/src/api/endpoints/othello/match.ts
index b73e105ef0..f73386ba7c 100644
--- a/src/api/endpoints/othello/match.ts
+++ b/src/api/endpoints/othello/match.ts
@@ -1,6 +1,6 @@
import $ from 'cafy';
import Matching, { pack as packMatching } from '../../models/othello-matching';
-import Game, { pack as packGame } from '../../models/othello-game';
+import OthelloGame, { pack as packGame } from '../../models/othello-game';
import User from '../../models/user';
import publishUserStream, { publishOthelloStream } from '../../event';
import { eighteight } from '../../../common/othello/maps';
@@ -28,7 +28,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
});
// Create game
- const game = await Game.insert({
+ const game = await OthelloGame.insert({
created_at: new Date(),
user1_id: exist.parent_id,
user2_id: user._id,