Get duplicates of a post

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-08-14 11:29:13 -04:00
parent 076c5bf30c
commit a76c468280
8 changed files with 532 additions and 41 deletions
+5 -5
View File
@@ -95,12 +95,12 @@ func (s *UserService) Get(ctx context.Context, username string) (*User, *Respons
// GetMultipleByID returns multiple users from their full IDs.
// The response body is a map where the keys are the IDs (if they exist), and the value is the user.
func (s *UserService) GetMultipleByID(ctx context.Context, ids ...string) (map[string]*UserSummary, *Response, error) {
type query struct {
type params struct {
IDs []string `url:"ids,omitempty,comma"`
}
path := "api/user_data_by_account_ids"
path, err := addOptions(path, query{ids})
path, err := addOptions(path, params{ids})
if err != nil {
return nil, nil, err
}
@@ -121,12 +121,12 @@ func (s *UserService) GetMultipleByID(ctx context.Context, ids ...string) (map[s
// UsernameAvailable checks whether a username is available for registration.
func (s *UserService) UsernameAvailable(ctx context.Context, username string) (bool, *Response, error) {
type query struct {
User string `url:"user,omitempty"`
type params struct {
User string `url:"user"`
}
path := "api/username_available"
path, err := addOptions(path, query{username})
path, err := addOptions(path, params{username})
if err != nil {
return false, nil, err
}