git add .

git commit -m "feat: improve wheel UI with gold pointer and center circle sync"
This commit is contained in:
2026-05-30 13:16:11 +03:30
parent c4c4e92e05
commit 1618580439
27 changed files with 1158 additions and 140 deletions

View File

@@ -30,7 +30,7 @@ def get_items(db: Session = Depends(get_db)):
logger.info(f"Items fetched: {len(items)} items")
return items
except Exception as e:
logger.error(f"Error fetching items: {e}")
logger.critical(f"Unexpected error fetching items: {e}")
raise
@@ -41,11 +41,11 @@ def create_item(
db: Session = Depends(get_db)
):
try:
result = crud.create_item(db, item.title)
result = crud.create_item(db, item.title, item.value) # ✅ value اضافه شد
logger.info(f"Item created: {item.title}")
return result
except Exception as e:
logger.error(f"Error creating item: {e}")
logger.critical(f"Unexpected error creating item: {e}")
raise
@@ -65,5 +65,29 @@ def delete_item(
except HTTPException:
raise
except Exception as e:
logger.error(f"Error deleting item: {e}")
raise
logger.critical(f"Unexpected error deleting item: {e}")
raise
@router.put("/items/{item_id}", response_model=ItemResponse)
def update_item(
item_id: int,
item: schemas.ItemCreate,
db: Session = Depends(get_db)
):
try:
updated = crud.update_item(db, item_id, item.title, item.value)
if not updated:
logger.warning(f"Item not found: {item_id}")
raise HTTPException(status_code=404, detail="Item not found")
logger.info(f"Item updated: {item_id}")
return updated
except HTTPException:
raise
except Exception as e:
logger.critical(f"Unexpected error updating item: {e}")
raise