1
This commit is contained in:
parent
60da68c342
commit
b49f0bb18c
@ -7,6 +7,7 @@ const serviceFactory = require('../services/factory');
|
|||||||
const { config, webhook } = require('@imtbl/sdk');
|
const { config, webhook } = require('@imtbl/sdk');
|
||||||
|
|
||||||
async function procEvent(event, rsp) {
|
async function procEvent(event, rsp) {
|
||||||
|
console.log(event);
|
||||||
const idx = 0;
|
const idx = 0;
|
||||||
const dbKey = 'BcEventDb' + idx;
|
const dbKey = 'BcEventDb' + idx;
|
||||||
const {err, conn} = await app.getDbConn(dbKey);
|
const {err, conn} = await app.getDbConn(dbKey);
|
||||||
@ -56,9 +57,9 @@ async function webhooks(req, rsp) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (events.length > 0) {
|
if (events.length > 0) {
|
||||||
|
await procEvent(events[0], rsp);
|
||||||
} else {
|
} else {
|
||||||
rsp.send(utils.jsonEncode({"status": "ok"}));
|
rsp.status(500).send("no event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user