aboutsummaryrefslogtreecommitdiff
path: root/controllers/dashboard/dns.go
blob: bbc646863549dc63be51af11d38383dcbc4eac07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package dashboard

import (
	dnsSystem "dove/utils/dns"
	"dove/utils/shortcuts"

	"github.com/gofiber/fiber/v2"
)

func ConfigureSystemDns(context *fiber.Ctx) error {
	configureError := dnsSystem.ConfigureSystemDns()
	if configureError != nil {
		return shortcuts.BadRequestError(context, configureError)
	}

	return shortcuts.RedirectToPath(context, "/dashboard")
}

func DisableSystemDns(context *fiber.Ctx) error {
	disableError := dnsSystem.DisableSystemDns()
	if disableError != nil {
		return shortcuts.BadRequestError(context, disableError)
	}

	return shortcuts.RedirectToPath(context, "/dashboard")
}