Skip to content

Commit

Permalink
Merge pull request #262 from ffapitalle/use_search_api_for_folder_search
Browse files Browse the repository at this point in the history
feat(folders): use API search endpoint for testing folder existence
  • Loading branch information
K-Phoen authored Jun 18, 2024
2 parents 16e9467 + 20c6864 commit bb1093e
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 @@ -70,7 +71,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?type=dash-folder&query=%s", url.QueryEscape(title)))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit bb1093e

Please sign in to comment.