Skip to content

Commit

Permalink
Saved search name cannot be changed once created (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnushreeHS authored Dec 5, 2023
1 parent 714be0e commit 2dc8f0d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rql/history/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,22 @@ func Get(c pc.PrismaCloudClient, id string) (Query, error) {
}

// Save saves an historic RQL search query to the saved searches list.
func Save(c pc.PrismaCloudClient, req SavedSearch) error {
func Save(c pc.PrismaCloudClient, req SavedSearch) (Query, error) {
c.Log(pc.LogAction, "(create) saved search: %s", req.Id)

var ans Query

// Sanity check the time range.
if err := req.TimeRange.SetType(); err != nil {
return err
return Query{}, err
}

path := make([]string, 0, len(Suffix)+1)
path = append(path, Suffix...)
path = append(path, req.Id)

_, err := c.Communicate("POST", path, nil, req, nil)
return err
_, err := c.Communicate("POST", path, nil, req, &ans)
return ans, err
}

// Delete removes an existing saved search query.
Expand Down

0 comments on commit 2dc8f0d

Please sign in to comment.