This commit is contained in:
@ -51,7 +51,7 @@ AdminRoute.get("/settings", async (ctx) => {
|
||||
|
||||
AdminRoute.get("/data", async (ctx) => {
|
||||
const { database } = ctx.query;
|
||||
let db = DatabaseManager.getDatabase(database);
|
||||
let db = DatabaseManager.getDatabase(database as string);
|
||||
if (!db) throw new BadRequestError("Database not found");
|
||||
let res = await new Promise<string[][]>((yes, no) => {
|
||||
const stream = db.data.createReadStream({
|
||||
@ -130,7 +130,7 @@ AdminRoute.get("/database", (ctx) => {
|
||||
|
||||
AdminRoute.get("/collections", async (ctx) => {
|
||||
const { database } = ctx.query;
|
||||
let db = DatabaseManager.getDatabase(database);
|
||||
let db = DatabaseManager.getDatabase(database as string);
|
||||
if (!db) throw new BadRequestError("Database not found");
|
||||
|
||||
let res = await new Promise<string[]>((yes, no) => {
|
||||
@ -156,7 +156,7 @@ AdminRoute.get("/collections", async (ctx) => {
|
||||
|
||||
AdminRoute.get("/collections/cleanup", async (ctx) => {
|
||||
const { database } = ctx.query;
|
||||
let db = DatabaseManager.getDatabase(database);
|
||||
let db = DatabaseManager.getDatabase(database as string);
|
||||
if (!db) throw new BadRequestError("Database not found");
|
||||
|
||||
let deleted = await db.runCleanup();
|
||||
@ -184,7 +184,7 @@ AdminRoute.get(
|
||||
|
||||
AdminRoute.get("/database/update", async (ctx) => {
|
||||
const { database } = ctx.query;
|
||||
let db = DatabaseManager.getDatabase(database);
|
||||
let db = DatabaseManager.getDatabase(database as string);
|
||||
if (!db) throw new NotFoundError("Database not found!");
|
||||
getForm("/v1/admin/database", "Change Database", {
|
||||
name: {
|
||||
|
@ -37,7 +37,7 @@ V1.post("/db/:database/query", async (ctx) => {
|
||||
}
|
||||
|
||||
if (authkey && db.publickey) {
|
||||
let res = await verifyJWT(authkey, db.publickey);
|
||||
let res = await verifyJWT(authkey as string, db.publickey);
|
||||
if (res && !res.uid && res.user) res.uid = res.user;
|
||||
if (!res || !res.uid) {
|
||||
throw new BadRequestError("Invalid JWT");
|
||||
|
Reference in New Issue
Block a user