diff --git a/src/routes/berrydash/profile/get.ts b/src/routes/berrydash/profile/get.ts index 4b9398e..c79c818 100644 --- a/src/routes/berrydash/profile/get.ts +++ b/src/routes/berrydash/profile/get.ts @@ -4,12 +4,8 @@ import { getDatabaseConnection, jsonResponse } from '../../../lib/util' -import { - berryDashUserData, - berryDashUserPosts, - users -} from '../../../lib/tables' -import { and, desc, eq } from 'drizzle-orm' +import { berryDashUserData, users } from '../../../lib/tables' +import { and, eq } from 'drizzle-orm' export async function handler (context: Context) { const dbInfo0 = getDatabaseConnection(0) diff --git a/src/routes/berrydash/profile/posts/delete.ts b/src/routes/berrydash/profile/posts/delete.ts index 56ef195..b1a0636 100644 --- a/src/routes/berrydash/profile/posts/delete.ts +++ b/src/routes/berrydash/profile/posts/delete.ts @@ -1,15 +1,7 @@ import { Context } from 'elysia' -import { - genTimestamp, - getDatabaseConnection, - jsonResponse -} from '../../../../lib/util' -import { - berryDashUserData, - berryDashUserPosts, - users -} from '../../../../lib/tables' -import { and, desc, eq } from 'drizzle-orm' +import { getDatabaseConnection, jsonResponse } from '../../../../lib/util' +import { berryDashUserData, berryDashUserPosts } from '../../../../lib/tables' +import { and, eq } from 'drizzle-orm' export async function handler (context: Context) { const dbInfo0 = getDatabaseConnection(0) @@ -20,13 +12,11 @@ export async function handler (context: Context) { { success: false, message: 'Failed to connect to database', data: null }, 500 ) - const { connection: connection0, db: db0 } = dbInfo0 const { connection: connection1, db: db1 } = dbInfo1 let authorizationToken = context.headers.authorization let idQuery = context.query.id ? parseInt(context.query.id, 10) : 0 if (!idQuery || idQuery < 1) { - connection0.end() connection1.end() return jsonResponse( { success: false, message: 'No valid post ID provided', data: null }, @@ -34,7 +24,6 @@ export async function handler (context: Context) { ) } if (!authorizationToken) { - connection0.end() connection1.end() return jsonResponse( { success: false, message: 'Unauthorized', data: null }, @@ -49,7 +38,6 @@ export async function handler (context: Context) { .execute() if (!userData[0]) { - connection0.end() connection1.end() return jsonResponse( { success: false, message: 'Unauthorized', data: null }, @@ -69,7 +57,6 @@ export async function handler (context: Context) { ) .execute() - connection0.end() connection1.end() if (result[0]) diff --git a/src/routes/launcher/versions.ts b/src/routes/launcher/versions.ts index 7777d3c..aa2ea8c 100644 --- a/src/routes/launcher/versions.ts +++ b/src/routes/launcher/versions.ts @@ -2,7 +2,6 @@ import { games, launcherVersionManifest } from '../../lib/tables' import { asc, desc, eq } from 'drizzle-orm' import { getDatabaseConnection, jsonResponse } from '../../lib/util' import { Context } from 'elysia' -import { boolean } from 'drizzle-orm/gel-core' export async function handler (context: Context) { const dbResult = getDatabaseConnection(0)