Open batazor opened 1 year ago
Please give me more infomation 😢
I mean to give the possibility to edit not only the username or his status or additional fields but also the time zone, title, and phone number and preferably by calling 1 method
@kanata2 At this moment we do a fork and add a custom method that allows us to change one call to user data - conventionally something like this:
// SetUserProfile will set a profile for the provided user
func (api *Client) SetUserProfile(user string, profile *UserProfile) error {
return api.SetUserProfileContext(context.Background(), user, profile)
}
// SetUserProfileContext will set a profile for the provided user with a custom context
func (api *Client) SetUserProfileContext(ctx context.Context, user string, profile *UserProfile) error {
data := map[string]interface{}{
"profile": profile,
}
if user != "" {
data["user"] = user
}
jsonProfile, err := json.Marshal(data)
if err != nil {
return err
}
response := &userResponseFull{}
if err = api.jsonMethod(ctx, "users.profile.set", jsonProfile, response); err != nil {
return err
}
return response.Err()
}
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Description
To set user status, name and other fields in one request