mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-20 00:15:40 +00:00
25 lines
585 B
Go
25 lines
585 B
Go
package admin
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
|
|
. "github.com/mickael-kerjean/filestash/server/pkg/config"
|
|
. "github.com/mickael-kerjean/filestash/server/pkg/core"
|
|
. "github.com/mickael-kerjean/filestash/server/pkg/kernel"
|
|
)
|
|
|
|
func PrivateConfigHandler(ctx *App, res http.ResponseWriter, req *http.Request) {
|
|
SendSuccessResult(res, &Config)
|
|
}
|
|
|
|
func PrivateConfigUpdateHandler(ctx *App, res http.ResponseWriter, req *http.Request) {
|
|
b, _ := io.ReadAll(req.Body)
|
|
if err := SaveConfig(b); err != nil {
|
|
SendErrorResult(res, err)
|
|
return
|
|
}
|
|
Config.Load()
|
|
SendSuccessResult(res, nil)
|
|
}
|