mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-29 11:46:55 +00:00
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:
@@ -168,7 +168,7 @@ export default function DnsRecordsPage() {
|
|||||||
if (!domainId) throw new Error("Domain ID is required");
|
if (!domainId) throw new Error("Domain ID is required");
|
||||||
|
|
||||||
// Convert empty providerId to null
|
// 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 = {
|
const recordData: InsertDnsRecord = {
|
||||||
...data,
|
...data,
|
||||||
@@ -204,7 +204,7 @@ export default function DnsRecordsPage() {
|
|||||||
const updateRecordMutation = useMutation({
|
const updateRecordMutation = useMutation({
|
||||||
mutationFn: async ({ id, data }: { id: string, data: z.infer<typeof dnsRecordSchema> }) => {
|
mutationFn: async ({ id, data }: { id: string, data: z.infer<typeof dnsRecordSchema> }) => {
|
||||||
// Convert empty providerId to null
|
// Convert empty providerId to null
|
||||||
const providerId = data.providerId === "" ? null : data.providerId;
|
const providerId = data.providerId === "" || data.providerId === "none" ? null : data.providerId;
|
||||||
|
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
...data,
|
...data,
|
||||||
@@ -518,7 +518,7 @@ export default function DnsRecordsPage() {
|
|||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="">None</SelectItem>
|
<SelectItem value="none">None</SelectItem>
|
||||||
{providers.map((provider) => (
|
{providers.map((provider) => (
|
||||||
<SelectItem
|
<SelectItem
|
||||||
key={provider.id}
|
key={provider.id}
|
||||||
@@ -758,7 +758,7 @@ export default function DnsRecordsPage() {
|
|||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="">None</SelectItem>
|
<SelectItem value="none">None</SelectItem>
|
||||||
{providers.map((provider) => (
|
{providers.map((provider) => (
|
||||||
<SelectItem
|
<SelectItem
|
||||||
key={provider.id}
|
key={provider.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user