fix(kb.gbapp): Use of await style call

This commit is contained in:
Joao Antonio Ferreira 2019-10-16 23:22:21 -03:00
parent d29dea459b
commit a034abf694
2 changed files with 4 additions and 11 deletions

View file

@ -114,7 +114,7 @@ export class GBDeployer {
const dirs = getDirectories(path);
dirs.forEach(element => {
if (element.startsWith('.')) {
if (element === '.') {
GBLog.info(`Ignoring ${element}...`);
} else {
if (element.endsWith('.gbot')) {
@ -494,7 +494,8 @@ export class GBDeployer {
try {
child_process.execSync(Path.join(process.env.PWD, 'node_modules/.bin/tsc'), { cwd: e });
import(e)
GBLog.info(`Importando o pacote '${e}' on dir ${process.env.PWD}`);
import(Path.join(process.env.PWD, e))
.then(m => {
const p = new m.Package();
p.loadPackage(core, core.sequelize);

View file

@ -140,15 +140,7 @@ export class KBService {
}
public async addAnswer(obj: GuaribasAnswer): Promise<GuaribasAnswer> {
return new Promise<GuaribasAnswer>((resolve, reject) => {
GuaribasAnswer.create(obj)
.then(item => {
resolve(item);
})
.error(reason => {
reject(reason);
});
});
return await GuaribasAnswer.create(obj);
}
public async ask(