feat(config): add API route for app configuration and update related logic for monitor guild

This commit is contained in:
MythEclipse
2026-06-01 11:16:07 +07:00
parent 49e9197ce0
commit 8310e58239
10 changed files with 154 additions and 32 deletions
+8
View File
@@ -48,6 +48,10 @@ export interface Guild {
icon: string | null;
}
export interface AppConfig {
monitorGuildId: string | null;
}
class ApiError extends Error {
code: string;
statusCode: number;
@@ -105,3 +109,7 @@ export async function reanalyzeMessage(id: string): Promise<void> {
export async function getGuilds(): Promise<Guild[]> {
return request<Guild[]>("/api/guilds");
}
export async function getAppConfig(): Promise<AppConfig> {
return request<AppConfig>("/api/config");
}