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
+19
View File
@@ -0,0 +1,19 @@
"use server";
import createClient from "@/actions/supa";
export async function getServerById(id: string) {
const supabase = await createClient();
const { error, data: server } = await supabase
.from("servers")
.select("id, name, created_at, owner, address, icon_url")
.eq("id", id)
.maybeSingle();
if (error) throw error;
if (!server) throw "Server is null";
return server;
}