diff --git a/package.json b/package.json index a620fa8..5fbf8f3 100644 --- a/package.json +++ b/package.json @@ -46,5 +46,6 @@ "prisma": "^5.12.1", "tailwindcss": "^3.4.1", "typescript": "^5" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/app/getBots/route.ts b/src/app/getBots/route.ts index cd66227..7f3f8a3 100644 --- a/src/app/getBots/route.ts +++ b/src/app/getBots/route.ts @@ -24,9 +24,22 @@ export async function GET(req: Request) { verified: true } }) - return new Response(JSON.stringify(dbFetch), { + return new Response(JSON.stringify(emptyValToNull(dbFetch)), { headers: { 'content-type': 'application/json' } }) +} + +function emptyValToNull(obj: any) { + for (const key in obj) { + if (typeof obj[key] === 'object') { + emptyValToNull(obj[key]); + } else { + if (obj[key] === '') { + obj[key] = null; + } + } + } + return obj; } \ No newline at end of file