refactor(io): added new method addChild

This commit is contained in:
Leifer Mendez
2022-11-30 21:04:45 +01:00
18 changed files with 9863 additions and 15 deletions

View File

@@ -1,15 +1,20 @@
/**
* Si necesitas saber que trae el "ctx"
* Puedes ver el README.md dentro packages/database
*/
class MockDatabase {
db
listHistory = []
constructor() {
/**
* Se debe cargar listHistory con historial de mensajes
* para que se pueda continuar el flow
*/
constructor() {}
getPrevByNumber = (from) => {
const history = this.listHistory.slice().reverse()
return history.find((a) => a.from === from)
}
save = (ctx) => {
console.log('Guardando DB...', ctx)
this.listHistory.push(ctx)
}
}