mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-14 05:38:01 -05:00
Tag query change
This commit is contained in:
parent
6d4683c9a3
commit
b66621b283
1 changed files with 4 additions and 3 deletions
|
@ -108,10 +108,11 @@ func (c *PaperlessClient) GetAllTags(ctx context.Context) (map[string]int, error
|
||||||
func (c *PaperlessClient) GetDocumentsByTags(ctx context.Context, tags []string) ([]Document, error) {
|
func (c *PaperlessClient) GetDocumentsByTags(ctx context.Context, tags []string) ([]Document, error) {
|
||||||
tagQueries := make([]string, len(tags))
|
tagQueries := make([]string, len(tags))
|
||||||
for i, tag := range tags {
|
for i, tag := range tags {
|
||||||
tagQueries[i] = fmt.Sprintf("tag:%s", tag)
|
tagQueries[i] = fmt.Sprintf("tags__name__iexact=%s", tag)
|
||||||
}
|
}
|
||||||
searchQuery := strings.Join(tagQueries, " ")
|
searchQuery := strings.Join(tagQueries, "&")
|
||||||
path := fmt.Sprintf("api/documents/?query=%s", urlEncode(searchQuery))
|
path := fmt.Sprintf("api/documents/?%s", urlEncode(searchQuery))
|
||||||
|
log.Printf("Get URL: %s", path)
|
||||||
|
|
||||||
resp, err := c.Do(ctx, "GET", path, nil)
|
resp, err := c.Do(ctx, "GET", path, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue