feat: reintroduce missing local dns override (fixes #236)
This commit is contained in:
parent
8819af270d
commit
87b8d64bcc
6 changed files with 88 additions and 6 deletions
|
|
@ -42,6 +42,8 @@ export async function dnsAction({
|
|||
return removeRecord(formData, context);
|
||||
case 'add_record':
|
||||
return addRecord(formData, context);
|
||||
case 'override_dns':
|
||||
return overrideDns(formData, context);
|
||||
default:
|
||||
return data({ success: false }, 400);
|
||||
}
|
||||
|
|
@ -230,3 +232,20 @@ async function addRecord(formData: FormData, context: LoadContext) {
|
|||
|
||||
await context.integration?.onConfigChange(context.client);
|
||||
}
|
||||
|
||||
async function overrideDns(formData: FormData, context: LoadContext) {
|
||||
const override = formData.get('override_dns')?.toString();
|
||||
if (!override) {
|
||||
return data({ success: false }, 400);
|
||||
}
|
||||
|
||||
const overrideValue = override === 'true';
|
||||
await context.hs.patch([
|
||||
{
|
||||
path: 'dns.override_local_dns',
|
||||
value: overrideValue,
|
||||
},
|
||||
]);
|
||||
|
||||
await context.integration?.onConfigChange(context.client);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue