Skip to content

Commit

Permalink
feat(folders): use API search endpoint for testing folder existence
Browse files Browse the repository at this point in the history
  • Loading branch information
ffapitalle committed May 24, 2024
1 parent 234e2b7 commit 3a29f45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion folders.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"net/http"
"net/url"
"strings"
)

Expand Down Expand Up @@ -69,7 +70,7 @@ func (client *Client) CreateFolder(ctx context.Context, name string) (*Folder, e

// GetFolderByTitle finds a folder, given its title.
func (client *Client) GetFolderByTitle(ctx context.Context, title string) (*Folder, error) {
resp, err := client.get(ctx, "/api/folders?limit=1000")
resp, err := client.get(ctx, fmt.Sprintf("/api/search?query=%s", url.QueryEscape(title)))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3a29f45

Please sign in to comment.