fix resource domain not required

This commit is contained in:
miloschwartz
2025-07-28 12:52:44 -07:00
parent 67bae76048
commit 80aa7502af
5 changed files with 27 additions and 23 deletions

View File

@@ -636,6 +636,7 @@ export default function GeneralForm() {
<CredenzaBody>
<DomainPicker
orgId={orgId as string}
cols={1}
onDomainChange={(res) => {
const selected = {
domainId: res.domainId,

View File

@@ -74,7 +74,7 @@ const baseResourceFormSchema = z.object({
});
const httpResourceFormSchema = z.object({
domainId: z.string().optional(),
domainId: z.string().nonempty(),
subdomain: z.string().optional()
});
@@ -277,9 +277,9 @@ export default function Page() {
if (res?.status === 200) {
const domains = res.data.data.domains;
setBaseDomains(domains);
if (domains.length) {
httpForm.setValue("domainId", domains[0].domainId);
}
// if (domains.length) {
// httpForm.setValue("domainId", domains[0].domainId);
// }
}
};
@@ -684,6 +684,8 @@ export default function Page() {
? await httpForm.trigger()
: await tcpUdpForm.trigger();
console.log(httpForm.getValues());
if (baseValid && settingsValid) {
onSubmit();
}

View File

@@ -134,4 +134,4 @@ export const adminNavSections: SidebarNavSection[] = [
: [])
]
}
];
];