add commander for cli flags
This commit is contained in:
@@ -20,10 +20,6 @@ export class CharacterService {
|
||||
characterManager: ICharacterManager
|
||||
databaseService: DatabaseService
|
||||
|
||||
// mongoClient: MongoClient
|
||||
// db: Db
|
||||
// characterCollection: Collection
|
||||
|
||||
constructor(databaseService: DatabaseService) {
|
||||
this.reflectionService = new ReflectionService(
|
||||
loadSync('./src/proto/character.proto'),
|
||||
@@ -35,10 +31,6 @@ export class CharacterService {
|
||||
}
|
||||
|
||||
this.databaseService = databaseService
|
||||
|
||||
// this.mongoClient = mongoClient
|
||||
// this.db = this.mongoClient.db(dbName)
|
||||
// this.characterCollection = this.db.collection('Characters')
|
||||
}
|
||||
|
||||
addToServer(server: Server) {
|
||||
@@ -51,17 +43,9 @@ export class CharacterService {
|
||||
call: ServerUnaryCall<CreateCharacterRequest, Character>,
|
||||
callback: sendUnaryData<Character>,
|
||||
) {
|
||||
|
||||
let newCharacter = await this.databaseService.insertCharacter(call.request.characterData)
|
||||
|
||||
// this.characterCollection
|
||||
// .insertOne(call.request.characterData)
|
||||
// .then((insertResult) => {
|
||||
// console.log(insertResult)
|
||||
// return this.characterCollection.findOne({
|
||||
// _id: insertResult.insertedId,
|
||||
// })
|
||||
// })
|
||||
let newCharacter = await this.databaseService.insertCharacter(
|
||||
call.request.characterData,
|
||||
)
|
||||
|
||||
console.log(newCharacter)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user