mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-27 10:47:01 +00:00
Fix: Resolve "Expected number, received nan" error in domain creation
Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/53412d8c-5ffa-4a44-813c-7cb46433d8c5.jpg
This commit is contained in:
@@ -49,9 +49,7 @@ import { Loader2 } from "lucide-react";
|
|||||||
// Domain form schema
|
// Domain form schema
|
||||||
const domainFormSchema = z.object({
|
const domainFormSchema = z.object({
|
||||||
name: z.string().min(3, "Domain name must be at least 3 characters"),
|
name: z.string().min(3, "Domain name must be at least 3 characters"),
|
||||||
providerId: z.number({
|
providerId: z.string().uuid().optional(),
|
||||||
required_error: "Please select a DNS provider",
|
|
||||||
}),
|
|
||||||
isActive: z.boolean().default(true),
|
isActive: z.boolean().default(true),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -88,7 +86,7 @@ export default function DomainsPage() {
|
|||||||
mutationFn: async (data: z.infer<typeof domainFormSchema>) => {
|
mutationFn: async (data: z.infer<typeof domainFormSchema>) => {
|
||||||
const domainData: InsertDomain = {
|
const domainData: InsertDomain = {
|
||||||
...data,
|
...data,
|
||||||
organizationId: currentOrganization?.id || 0,
|
organizationId: currentOrganization?.id || "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await apiRequest("POST", "/api/domains", domainData);
|
const res = await apiRequest("POST", "/api/domains", domainData);
|
||||||
@@ -114,7 +112,7 @@ export default function DomainsPage() {
|
|||||||
|
|
||||||
// Delete domain mutation
|
// Delete domain mutation
|
||||||
const deleteDomainMutation = useMutation({
|
const deleteDomainMutation = useMutation({
|
||||||
mutationFn: async (domainId: number) => {
|
mutationFn: async (domainId: string) => {
|
||||||
await apiRequest("DELETE", `/api/domains/${domainId}`);
|
await apiRequest("DELETE", `/api/domains/${domainId}`);
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
@@ -209,8 +207,8 @@ export default function DomainsPage() {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>DNS Provider</FormLabel>
|
<FormLabel>DNS Provider</FormLabel>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={(value) => field.onChange(parseInt(value))}
|
onValueChange={(value) => field.onChange(value)}
|
||||||
defaultValue={field.value?.toString()}
|
defaultValue={field.value}
|
||||||
>
|
>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<SelectTrigger>
|
<SelectTrigger>
|
||||||
|
|||||||
Reference in New Issue
Block a user