add settings response type, destructure

This commit is contained in:
Alex Holliday committed 2026-08-25 09:39:56 -07:00
1 parent ccfda938d5
commit 0c21dcdd2a
2 files changed
+8 -6

No files matched your search

+6 -6
View File
@@ -46,6 +46,7 @@ import {
} from "@/Types/Monitor";
import type { Notification } from "@/Types/Notification";
import type { Tag } from "@/Types/Tag";
import type { AppSettingsResponse } from "@/Types/Settings";
import {
stepFieldsFor,
monitorStepCount,
@@ -273,10 +274,7 @@ const CreateMonitorPage = () => {
const { data: games } = useGet<GamesMap>("/monitors/games");
const { data: tags } = useGet<Tag[]>("/tags/team");
const { data: proxies } = useGet<ProxyResponse[]>("/proxies/team");
const { data: appSettings } = useGet<{
globalProxyEnabled?: boolean;
globalProxyId?: string | null;
}>("/settings");
const { data: appSettings } = useGet<AppSettingsResponse>("/settings");
const { schema, defaults } = useMonitorForm({
data: existingMonitor ?? null,
@@ -505,10 +503,12 @@ const CreateMonitorPage = () => {
);
const globalProxyName =
appSettings?.globalProxyEnabled === true
? proxies?.find((proxy) => proxy.id === appSettings?.globalProxyId)?.name
appSettings?.settings?.globalProxyEnabled === true
? proxies?.find((proxy) => proxy.id === appSettings?.settings?.globalProxyId)?.name
: undefined;
console.log({ appSettings });
return (
<FormProvider {...form}>
<BasePage
+2
View File
@@ -24,6 +24,8 @@ export interface Settings {
showURL: boolean;
singleton: boolean;
globalThresholds?: SettingsThresholds;
globalProxyEnabled: boolean;
globalProxyId?: string | null;
createdAt: string;
updatedAt: string;
}