Skip to content

Commit be93d06

Browse files
committed
model of filter logic
1 parent 7169a0a commit be93d06

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

modal_backend/routes/notes.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,26 @@
2929

3030

3131
@note.get("", response_model=list[NoteGet])
32-
async def get_notes(type_id: int = Query(None), user=Depends(UnionAuth())) -> list[NoteGet]:
32+
async def get_notes(
33+
limit: int = 10,
34+
offset: int = 0,
35+
type_id: int = Query(None),
36+
groups_id: list[int] = Query(None),
37+
services_id: list[int] = Query(None),
38+
status: str = Query(
39+
enum=["active", "archived"],
40+
default=None,
41+
),
42+
asc_order: bool = False,
43+
user=Depends(UnionAuth()),
44+
) -> list[NoteGet]:
3345
"""
3446
Получить список модалок по type_id.
3547
3648
В случае несуществующего type_id ошибка ObjectNotFound
3749
"""
50+
51+
# add filter logic
3852
notes = await NoteService.get_note_by_type_id(db, type_id)
3953
return [NoteGet.model_validate(note) for note in notes]
4054

0 commit comments

Comments
 (0)