summaryrefslogtreecommitdiff
path: root/src/api/models/othello-session.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-07 11:40:40 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-07 11:40:40 +0900
commit6c495268aec2d2fa02ac16dbc119fb9c4e34cdae (patch)
tree4752806e22d15698b02bac88777ee70486566588 /src/api/models/othello-session.ts
parentwip (diff)
downloadsharkey-6c495268aec2d2fa02ac16dbc119fb9c4e34cdae.tar.gz
sharkey-6c495268aec2d2fa02ac16dbc119fb9c4e34cdae.tar.bz2
sharkey-6c495268aec2d2fa02ac16dbc119fb9c4e34cdae.zip
wip
Diffstat (limited to 'src/api/models/othello-session.ts')
-rw-r--r--src/api/models/othello-session.ts29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/api/models/othello-session.ts b/src/api/models/othello-session.ts
deleted file mode 100644
index 0aa1d01e54..0000000000
--- a/src/api/models/othello-session.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import * as mongo from 'mongodb';
-import deepcopy = require('deepcopy');
-import db from '../../db/mongodb';
-
-const Session = db.get<ISession>('othello_sessions');
-export default Session;
-
-export interface ISession {
- _id: mongo.ObjectID;
- code: string;
- user_id: mongo.ObjectID;
-}
-
-/**
- * Pack an othello session for API response
- *
- * @param {any} session
- * @return {Promise<any>}
- */
-export const pack = (
- session: any
-) => new Promise<any>(async (resolve, reject) => {
-
- const _session = deepcopy(session);
-
- delete _session._id;
-
- resolve(_session);
-});