fix(settings): add captchaEnabled switch to client config

This commit is contained in:
hexxa 2022-01-27 22:24:35 +08:00 committed by Hexxa
parent 99b424ee2a
commit 67da1ea0eb
3 changed files with 40 additions and 17 deletions

View file

@ -5,7 +5,7 @@ import (
"fmt"
"net/http"
"github.com/ihexxa/quickshare/src/db/sitestore"
// "github.com/ihexxa/quickshare/src/db/sitestore"
"github.com/ihexxa/quickshare/src/handlers/settings"
"github.com/parnurzeal/gorequest"
)
@ -46,12 +46,10 @@ func (cl *SettingsClient) GetClientCfg(token *http.Cookie) (*http.Response, *set
return resp, mResp, nil
}
func (cl *SettingsClient) SetClientCfg(cfg *sitestore.ClientConfig, token *http.Cookie) (*http.Response, string, []error) {
func (cl *SettingsClient) SetClientCfg(cfgMsg *settings.ClientCfgMsg, token *http.Cookie) (*http.Response, string, []error) {
return cl.r.Patch(cl.url("/v1/settings/client")).
AddCookie(token).
Send(&settings.ClientCfgMsg{
ClientCfg: cfg,
}).
Send(cfgMsg).
End()
}