Skip to content

Commit 64dc7bc

Browse files
fix(thing_helper): Patch borken sql varible & typing
1 parent aa30211 commit 64dc7bc

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

api/thing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ def get_springs(
297297
order: str = None,
298298
filter_params: Annotated[list[str] | None, Query(alias="filter")] = None,
299299
query: str = None,
300-
name_contains: Optional[str] = None,
301300
) -> CustomPage[SpringResponse]:
302301
"""
303302
Retrieve all springs from the database.
@@ -311,7 +310,6 @@ def get_springs(
311310
sort,
312311
thing_type=thing_type,
313312
filters=filter_params,
314-
name_contains=name_contains,
315313
)
316314

317315

services/thing_helper.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import logging
1717
import time
1818
from datetime import datetime
19-
from typing import Optional, Sequence
19+
from typing import Any, Optional, Sequence
2020
from zoneinfo import ZoneInfo
2121

2222
from fastapi import HTTPException, Request
@@ -125,7 +125,8 @@ def get_db_things(
125125
name: Optional[str] = None,
126126
include_contacts: bool = False,
127127
filters: Optional[list[str]] = None,
128-
) -> list:
128+
) -> CustomPage[Any]:
129+
sql = select(Thing)
129130

130131
# Querying logic
131132
#
@@ -187,9 +188,6 @@ def get_db_things(
187188
ThingContactAssociation.contact
188189
)
189190
)
190-
else:
191-
# No search query → return base query (no filtering)
192-
sql = select(Thing)
193191

194192
if thing_type:
195193
sql = sql.where(Thing.thing_type == thing_type)

0 commit comments

Comments
 (0)