add avatar upload
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user