Implement POST /users/ids endpoint for APIv4 (#5274)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
177589b1e2
Коммит
ccb0343828
@@ -210,6 +210,16 @@ func (c *Client4) GetUser(userId, etag string) (*User, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetUsersByIds returns a list of users based on the provided user ids.
|
||||
func (c *Client4) GetUsersByIds(userIds []string) ([]*User, *Response) {
|
||||
if r, err := c.DoApiPost(c.GetUsersRoute()+"/ids", ArrayToJson(userIds)); err != nil {
|
||||
return nil, &Response{StatusCode: r.StatusCode, Error: err}
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return UserListFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateUser updates a user in the system based on the provided user struct.
|
||||
func (c *Client4) UpdateUser(user *User) (*User, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetUserRoute(user.Id), user.ToJson()); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user