This commit is contained in:
aozhiwei 2024-06-11 19:07:56 +08:00
parent 60da68c342
commit b49f0bb18c

View File

@ -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");
} }
} }