fix
This commit is contained in:
parent
24bb5cd0ea
commit
bc9d3e3d3f
|
|
@ -5,16 +5,17 @@ export const _ = {
|
||||||
url: "/_dbs/:dbName/:action",
|
url: "/_dbs/:dbName/:action",
|
||||||
async api(dbName: any, action?: string) {
|
async api(dbName: any, action?: string) {
|
||||||
const { req, res } = apiContext(this);
|
const { req, res } = apiContext(this);
|
||||||
|
if (typeof db !== "undefined") {
|
||||||
|
const body = req.params;
|
||||||
|
|
||||||
const body = req.params;
|
try {
|
||||||
|
const result = await execQuery(body, db);
|
||||||
try {
|
res.send(result);
|
||||||
const result = await execQuery(body, db);
|
} catch (e: any) {
|
||||||
res.send(result);
|
res.sendStatus(500);
|
||||||
} catch (e: any) {
|
res.send(e.message);
|
||||||
res.sendStatus(500);
|
console.error(e);
|
||||||
res.send(e.message);
|
}
|
||||||
console.error(e);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue