fix: properly handle removing the last split dns record

Previously it would set the value to an empty array, breaking DNS resolution for that split completely.
The correct behavior was to remove the key altogether! This fixes #231
This commit is contained in:
Aarnav Tale
2025-06-21 13:07:39 -04:00
parent 1150d1616e
commit 8819af270d
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ async function removeNs(formData: FormData, context: LoadContext) {
await context.hs.patch([
{
path: `dns.nameservers.split."${splitName}"`,
value: servers,
value: servers.length > 0 ? servers : null,
},
]);
}