fix(kb.gbapp): Use of await style call
This commit is contained in:
parent
d29dea459b
commit
a034abf694
2 changed files with 4 additions and 11 deletions
|
@ -114,7 +114,7 @@ export class GBDeployer {
|
||||||
|
|
||||||
const dirs = getDirectories(path);
|
const dirs = getDirectories(path);
|
||||||
dirs.forEach(element => {
|
dirs.forEach(element => {
|
||||||
if (element.startsWith('.')) {
|
if (element === '.') {
|
||||||
GBLog.info(`Ignoring ${element}...`);
|
GBLog.info(`Ignoring ${element}...`);
|
||||||
} else {
|
} else {
|
||||||
if (element.endsWith('.gbot')) {
|
if (element.endsWith('.gbot')) {
|
||||||
|
@ -494,7 +494,8 @@ export class GBDeployer {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
child_process.execSync(Path.join(process.env.PWD, 'node_modules/.bin/tsc'), { cwd: e });
|
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 => {
|
.then(m => {
|
||||||
const p = new m.Package();
|
const p = new m.Package();
|
||||||
p.loadPackage(core, core.sequelize);
|
p.loadPackage(core, core.sequelize);
|
||||||
|
|
|
@ -140,15 +140,7 @@ export class KBService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async addAnswer(obj: GuaribasAnswer): Promise<GuaribasAnswer> {
|
public async addAnswer(obj: GuaribasAnswer): Promise<GuaribasAnswer> {
|
||||||
return new Promise<GuaribasAnswer>((resolve, reject) => {
|
return await GuaribasAnswer.create(obj);
|
||||||
GuaribasAnswer.create(obj)
|
|
||||||
.then(item => {
|
|
||||||
resolve(item);
|
|
||||||
})
|
|
||||||
.error(reason => {
|
|
||||||
reject(reason);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async ask(
|
public async ask(
|
||||||
|
|
Loading…
Add table
Reference in a new issue