diff --git a/cmd/server.go b/cmd/server.go index e37b48f..2b36000 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -441,13 +441,7 @@ func handleAdminDocumentsUploadPOST(c echo.Context) error { Message string } - client, err := api.New(cfg.Server.Api.Protocol, cfg.Server.Api.Host, cfg.Server.Port, api.APIOptions{ - KeyAuth: cfg.Server.Api.Auth, - Key: cfg.Server.Api.Key, - BasicAuth: cfg.Server.Admin.Auth, - Username: cfg.Server.Admin.Username, - Password: cfg.Server.Admin.Password, - }) + client, err := api.NewApiClientFromViper() if err != nil { data.Message = fmt.Sprintf("handleAdminDocumentsUploadPOST#api.New: %s", err) return c.Render(http.StatusInternalServerError, "admin-upload-html", data)