add avatar upload

This commit is contained in:
kandrusyak
2023-07-28 01:05:30 +03:00
parent 59b937bce6
commit 1a82f01101
3 changed files with 15 additions and 1 deletions

View File

@@ -134,3 +134,17 @@ func GetPositions(c echo.Context) error {
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
}
func UploadAvatar(c echo.Context) error {
id := c.Param("id")
data, err, resp := api.PostRequest(
config.Env.MSHosts.UsersHost+"/"+id+"/avatar",
c.Request().Body,
c.Request().Header)
if err != nil {
return c.NoContent(http.StatusBadGateway)
}
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
}