This commit is contained in:
@ -4,18 +4,18 @@ import { DatabaseManager } from "../../database/database";
|
||||
import {
|
||||
NotFoundError,
|
||||
NoPermissionError,
|
||||
BadRequestError
|
||||
BadRequestError,
|
||||
} from "../helper/errors";
|
||||
import Logging from "@hibas123/nodelogging";
|
||||
import Session from "../../database/session";
|
||||
import nanoid = require("nanoid");
|
||||
import { nanoid } from "nanoid";
|
||||
import { verifyJWT } from "../../helper/jwt";
|
||||
import { QueryError } from "../../database/query";
|
||||
const V1 = new Router({ prefix: "/v1" });
|
||||
|
||||
V1.use("/admin", AdminRoute.routes(), AdminRoute.allowedMethods());
|
||||
|
||||
V1.post("/db/:database/query", async ctx => {
|
||||
V1.post("/db/:database/query", async (ctx) => {
|
||||
const { database } = ctx.params;
|
||||
const { accesskey, authkey, rootkey } = ctx.query;
|
||||
|
||||
@ -52,7 +52,7 @@ V1.post("/db/:database/query", async ctx => {
|
||||
}
|
||||
}
|
||||
|
||||
ctx.body = await db.run([query], session).catch(err => {
|
||||
ctx.body = await db.run([query], session).catch((err) => {
|
||||
if (err instanceof QueryError) {
|
||||
throw new BadRequestError(err.message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user