fix: resolve type errors and lint components/routes

This commit is contained in:
Aarnav Tale 2025-01-06 08:18:46 +05:30
parent 414b95c293
commit 6745ee8529
No known key found for this signature in database
13 changed files with 63 additions and 28 deletions

View file

@ -48,7 +48,7 @@ export default function Nameservers({ nameservers, isDisabled }: Props) {
interface ListProps {
isGlobal: boolean;
isDisabled: boolean;
nameservers: string[];
nameservers: Record<string, string[]>;
name: string;
}

View file

@ -43,22 +43,22 @@ export async function loader() {
export async function action({ request }: ActionFunctionArgs) {
const session = await getSession(request.headers.get('Cookie'));
if (!session.has('hsApiKey')) {
return send({ success: false }, 401);
return data({ success: false }, { status: 401 });
}
const context = await loadContext();
if (!context.config.write) {
return send({ success: false }, 403);
return data({ success: false }, { status: 403 });
}
const data = (await request.json()) as Record<string, unknown>;
await patchConfig(data);
const patch = (await request.json()) as Record<string, unknown>;
await patchConfig(patch);
if (context.integration?.onConfigChange) {
await context.integration.onConfigChange(context.integration.context);
}
return { success: true };
return data({ success: true });
}
export default function Page() {