Fix: Handle "None" provider selection in DNS record management.

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/62bba02a-dc54-4742-a2dc-90482cad273d.jpg
This commit is contained in:
alphaeusmote
2025-04-10 15:03:44 +00:00
parent e932564099
commit 098fc7f7c7
+4 -4
View File
@@ -168,7 +168,7 @@ export default function DnsRecordsPage() {
if (!domainId) throw new Error("Domain ID is required");
// Convert empty providerId to null
const providerId = data.providerId === "" ? null : data.providerId;
const providerId = data.providerId === "" || data.providerId === "none" ? null : data.providerId;
const recordData: InsertDnsRecord = {
...data,
@@ -204,7 +204,7 @@ export default function DnsRecordsPage() {
const updateRecordMutation = useMutation({
mutationFn: async ({ id, data }: { id: string, data: z.infer<typeof dnsRecordSchema> }) => {
// Convert empty providerId to null
const providerId = data.providerId === "" ? null : data.providerId;
const providerId = data.providerId === "" || data.providerId === "none" ? null : data.providerId;
const updatedData = {
...data,
@@ -518,7 +518,7 @@ export default function DnsRecordsPage() {
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="">None</SelectItem>
<SelectItem value="none">None</SelectItem>
{providers.map((provider) => (
<SelectItem
key={provider.id}
@@ -758,7 +758,7 @@ export default function DnsRecordsPage() {
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="">None</SelectItem>
<SelectItem value="none">None</SelectItem>
{providers.map((provider) => (
<SelectItem
key={provider.id}