From 8fe8326dd01a7ca917f8eeb0f47200bedb1e048d Mon Sep 17 00:00:00 2001 From: Medicopter117 Date: Sun, 29 Mar 2026 10:47:00 +0200 Subject: [PATCH] feat: implement dashboard API routes, and create a searchable select UI component. --- src/api/dashboard/routes.py | 9 +++++++-- src/web/components/ui/SearchableSelect.tsx | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/api/dashboard/routes.py b/src/api/dashboard/routes.py index 21c7e7d..b79d871 100644 --- a/src/api/dashboard/routes.py +++ b/src/api/dashboard/routes.py @@ -200,7 +200,8 @@ async def get_guild_roles(guild_id: int, user: dict = Depends(get_current_user)) roles = [ {"id": str(r.id), "name": r.name, "color": str(r.color)} - for r in guild.roles if not r.is_default() and not r.managed + for r in guild.roles + if not r.is_default() and not r.managed ] return {"roles": roles} @@ -397,7 +398,11 @@ async def get_mega_data(guild_id: int, user: dict = Depends(get_current_user)): # 3. Fetch Metadata channels = [{"id": str(c.id), "name": c.name} for c in guild.text_channels] - roles = [{"id": str(r.id), "name": r.name, "color": str(r.color)} for r in guild.roles if not r.is_default() and not r.managed] + roles = [ + {"id": str(r.id), "name": r.name, "color": str(r.color)} + for r in guild.roles + if not r.is_default() and not r.managed + ] categories = [{"id": str(c.id), "name": c.name} for c in guild.categories] voice_channels = [{"id": str(c.id), "name": c.name} for c in guild.voice_channels] diff --git a/src/web/components/ui/SearchableSelect.tsx b/src/web/components/ui/SearchableSelect.tsx index 3643fc8..052c5c3 100644 --- a/src/web/components/ui/SearchableSelect.tsx +++ b/src/web/components/ui/SearchableSelect.tsx @@ -67,7 +67,7 @@ export function SearchableSelect({ {type === "role" && (
)} {selectedOption.name} @@ -107,7 +107,7 @@ export function SearchableSelect({ {type === "role" && (
)} {option.name}