mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-15 17:36:37 +00:00
fix resource domain not required
This commit is contained in:
@@ -636,6 +636,7 @@ export default function GeneralForm() {
|
||||
<CredenzaBody>
|
||||
<DomainPicker
|
||||
orgId={orgId as string}
|
||||
cols={1}
|
||||
onDomainChange={(res) => {
|
||||
const selected = {
|
||||
domainId: res.domainId,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -134,4 +134,4 @@ export const adminNavSections: SidebarNavSection[] = [
|
||||
: [])
|
||||
]
|
||||
}
|
||||
];
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user