Server supabase structure

This commit is contained in:
2025-12-23 15:31:44 +01:00
parent 8d9b60def0
commit 6d4cbbf03b
5 changed files with 26 additions and 35 deletions
-27
View File
@@ -1,27 +0,0 @@
import { NextRequest, NextResponse } from "next/server";
import { supabase } from "../../supa";
import { StatusCodes } from "http-status-codes";
/**
* GET /api/server/<id>
*/
export async function GET(
req: NextRequest,
{ params }: { params: Promise<{ id: string }> }
) {
const { id } = await params;
const { data: profile } = await supabase
.from("servers")
.select("id, name, created_at, owner, address, icon_url")
.eq("id", id)
.maybeSingle();
if (!profile)
return NextResponse.json(
{ message: "not found" },
{ status: StatusCodes.NOT_FOUND }
);
return NextResponse.json({ message: "ok", ...profile });
}