(database): Initial commit
This commit is contained in:
parent
0b15fd897b
commit
e7bf718fa6
2 changed files with 4 additions and 2 deletions
|
|
@ -4,11 +4,13 @@ import { FastifyInstance, FastifyPluginAsync } from 'fastify';
|
||||||
import { Database as DbImpl } from './mixin/_base';
|
import { Database as DbImpl } from './mixin/_base';
|
||||||
import { IUserDb, UserImpl } from './mixin/user';
|
import { IUserDb, UserImpl } from './mixin/user';
|
||||||
import { IBlockedDb, BlockedImpl } from './mixin/blocked';
|
import { IBlockedDb, BlockedImpl } from './mixin/blocked';
|
||||||
|
import { ITicTacToeDb, TicTacToeImpl } from './mixin/tictactoe';
|
||||||
|
|
||||||
Object.assign(DbImpl.prototype, UserImpl);
|
Object.assign(DbImpl.prototype, UserImpl);
|
||||||
Object.assign(DbImpl.prototype, BlockedImpl);
|
Object.assign(DbImpl.prototype, BlockedImpl);
|
||||||
|
Object.assign(DbImpl.prototype, TicTacToeImpl);
|
||||||
|
|
||||||
export interface Database extends DbImpl, IUserDb, IBlockedDb { }
|
export interface Database extends DbImpl, IUserDb, IBlockedDb, ITicTacToeDb { }
|
||||||
|
|
||||||
// When using .decorate you have to specify added properties for Typescript
|
// When using .decorate you have to specify added properties for Typescript
|
||||||
declare module 'fastify' {
|
declare module 'fastify' {
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ async function onReady(fastify: FastifyInstance, game: TTC) {
|
||||||
turn: game.currentPlayer,
|
turn: game.currentPlayer,
|
||||||
lastResult: result,
|
lastResult: result,
|
||||||
});
|
});
|
||||||
// setGameOutcome();
|
// fastify.db.setGameOutcome(this, "011001");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue