Skip to content

Commit

Permalink
Merge pull request #13 from iLert/feature/improve-data-source-search
Browse files Browse the repository at this point in the history
Feature/improve data source search - fixes
  • Loading branch information
STLVRTX authored Sep 6, 2022
2 parents 7554192 + 38b2160 commit 8f72a7b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 06.09.2022, Version 2.2.1

- fix alert action search method
- fix connector search method
- change user search

## 04.09.2022, Version 2.2.0

- add search by name for all entities
Expand Down
4 changes: 2 additions & 2 deletions alertaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ type SearchAlertActionInput struct {
// SearchAlertActionOutput represents the output of a SearchAlertAction operation.
type SearchAlertActionOutput struct {
_ struct{}
AlertAction *AlertAction
AlertAction *AlertActionOutput
}

// SearchAlertAction gets the alertAction with specified name.
Expand All @@ -369,7 +369,7 @@ func (c *Client) SearchAlertAction(input *SearchAlertActionInput) (*SearchAlertA
return nil, apiErr
}

alertAction := &AlertAction{}
alertAction := &AlertActionOutput{}
err = json.Unmarshal(resp.Body(), alertAction)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ type SearchConnectorInput struct {
// SearchConnectorOutput represents the output of a SearchConnector operation.
type SearchConnectorOutput struct {
_ struct{}
Connector *Connector
Connector *ConnectorOutput
}

// SearchConnector gets the connector with specified name.
Expand All @@ -345,7 +345,7 @@ func (c *Client) SearchConnector(input *SearchConnectorInput) (*SearchConnectorO
return nil, apiErr
}

connector := &Connector{}
connector := &ConnectorOutput{}
err = json.Unmarshal(resp.Body(), connector)
if err != nil {
return nil, err
Expand Down
10 changes: 5 additions & 5 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ func (c *Client) GetUsers(input *GetUsersInput) (*GetUsersOutput, error) {

// SearchUserInput represents the input of a SearchUser operation.
type SearchUserInput struct {
_ struct{}
UserName *string
_ struct{}
UserEmail *string
}

// SearchUserOutput represents the output of a SearchUser operation.
Expand All @@ -283,11 +283,11 @@ func (c *Client) SearchUser(input *SearchUserInput) (*SearchUserOutput, error) {
if input == nil {
return nil, errors.New("input is required")
}
if input.UserName == nil {
return nil, errors.New("username is required")
if input.UserEmail == nil {
return nil, errors.New("user email is required")
}

resp, err := c.httpClient.R().Get(fmt.Sprintf("%s/name/%s", apiRoutes.users, *input.UserName))
resp, err := c.httpClient.R().SetBody(User{Email: *input.UserEmail}).Post(fmt.Sprintf("%s/search-email", apiRoutes.users))
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ilert

// Version package version
const Version = "v2.2.0"
const Version = "v2.2.1"

0 comments on commit 8f72a7b

Please sign in to comment.