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
+3 -4
View File
@@ -9,6 +9,7 @@ import { Channel, Server } from "@/types/types";
import Cookies from "js-cookie";
import { toast } from "sonner";
import { getProfileById } from "@/actions/get-profile";
import { getServerById } from "@/actions/get-server";
export default function useApp(): App {
const node = useRef<WebSocket | null>(null);
@@ -30,11 +31,9 @@ export default function useApp(): App {
.split(",")
.map((x) => x.trim())
.filter((id) => id)
.map((id) => get(`/api/server/${id}`))
.map((id) => getServerById(id))
)
.then((o) =>
setServers(Object.fromEntries(o.map((i) => [i.data.id, i.data])))
)
.then((o) => setServers(Object.fromEntries(o.map((i) => [i.id, i]))))
.catch(toast.error);
}, []);