This commit is contained in:
Leifer Mendez
2022-11-09 13:23:07 +01:00
parent 9de4777cdb
commit ceb6faa5af
9 changed files with 102 additions and 68 deletions

View File

@@ -1,10 +1,18 @@
class DatabaseClass {
history = []
engineDB
constructor(_engineDB) {
this.engineDB = _engineDB
}
/**
* Se debe guardar mensaje numero
* @param {*} ctx
* @returns
*/
saveLog = (ctx) => {
this.history.pop()
this.history.push(ctx)
this.engineDB.save(ctx)
return ctx
}

View File

@@ -13,7 +13,7 @@ const prepareEngine = ({ engine, credentials }) => {
* @param {*} args
* @returns
*/
const create = (args) => {
const create = async (args) => {
const engine = prepareEngine(args)
return new DatabaseClass(engine)
}