Skip to content

Commit bfb5028

Browse files
code-rootclaude
andcommitted
fix: convert all sync database endpoints from async to sync
All firmware entry endpoints (list, create, update, delete, sync) use Session (sync SQLAlchemy), so they must not be async. Changed endpoints: - GET /api/firmware/entries - POST /api/firmware/entries - PUT /api/firmware/entries/{entry_id} - DELETE /api/firmware/entries/{entry_id} - POST /api/firmware/sync This fixes AttributeError issues when accessing database through sync Session. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 8d8e770 commit bfb5028

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎backend/api/routes/firmware_route.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ async def list_available_packages(
319319

320320

321321
@router.get("/entries")
322-
async def list_firmware_entries(
322+
def list_firmware_entries(
323323
model: Optional[str] = None,
324324
csc: Optional[str] = None,
325325
db: Session = Depends(get_db),
@@ -346,7 +346,7 @@ async def list_firmware_entries(
346346

347347

348348
@router.post("/entries")
349-
async def create_firmware_entry(
349+
def create_firmware_entry(
350350
req: FirmwareEntryCreate,
351351
db: Session = Depends(get_db),
352352
_user: User = Depends(get_current_user),
@@ -387,7 +387,7 @@ async def create_firmware_entry(
387387

388388

389389
@router.put("/entries/{entry_id}")
390-
async def update_firmware_entry(
390+
def update_firmware_entry(
391391
entry_id: int,
392392
req: FirmwareEntryUpdate,
393393
db: Session = Depends(get_db),
@@ -415,7 +415,7 @@ async def update_firmware_entry(
415415

416416

417417
@router.delete("/entries/{entry_id}")
418-
async def delete_firmware_entry(
418+
def delete_firmware_entry(
419419
entry_id: int,
420420
db: Session = Depends(get_db),
421421
_user: User = Depends(get_current_user),
@@ -438,7 +438,7 @@ async def delete_firmware_entry(
438438

439439

440440
@router.post("/sync")
441-
async def sync_firmware_entries(
441+
def sync_firmware_entries(
442442
db: Session = Depends(get_db),
443443
_user: User = Depends(get_current_user),
444444
) -> Dict[str, Any]:

0 commit comments

Comments
 (0)