Merge branch 'main' into refactor/models
This commit is contained in:
commit
9975d4032d
2 changed files with 4 additions and 7 deletions
|
@ -41,6 +41,9 @@ type UploadDocumentResponseInfo struct {
|
|||
Size float64 `json:"size"`
|
||||
}
|
||||
|
||||
// NewApiClientFromViper returns a pointer to a new API object,
|
||||
// provided the configuration options are managed by
|
||||
// https://git.agecem.com/agecem/agecem-org/config
|
||||
func NewApiClientFromViper() (*API, error) {
|
||||
var config config.Config
|
||||
|
||||
|
|
|
@ -424,13 +424,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)
|
||||
|
|
Loading…
Reference in a new issue