Skip to content

Commit a792c73

Browse files
ImTotemclaude
andcommitted
feat(shorten): add title and code search filters to LinkFilterInput
search_fields: title, code (LIKE/substring matching) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c1c872 commit a792c73

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/bcsd_api/filter/links.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
class LinkFilter(BaseFilter):
77
creator_id: str | None = None
88
expired: str | None = None
9+
title: str | None = None
10+
code: str | None = None
11+
12+
search_fields: list[str] = ["title", "code"]
913

1014
@field_validator("expired", mode="before")
1115
@classmethod

src/bcsd_api/shorten/resolvers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _to_filter(inp: LinkFilterInput) -> LinkFilter:
2424
page=inp.page, size=inp.size,
2525
sorts=to_sorts(inp.sorts),
2626
creator_id=inp.creator_id, expired=inp.expired,
27+
title=inp.title, code=inp.code,
2728
)
2829

2930

src/bcsd_api/shorten/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class LinkFilterInput:
5858
sorts: list[SortFieldInput] | None = None
5959
creator_id: str | None = None
6060
expired: str | None = None
61+
title: str | None = None
62+
code: str | None = None
6163

6264

6365
@strawberry.input

0 commit comments

Comments
 (0)