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: {
|
||||
|
Reference in New Issue
Block a user