Skip to content

Commit 33eecd6

Browse files
committed
Remove unused function
1 parent f6bcf2d commit 33eecd6

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

fastapi-python-web-apis/main_start.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,3 @@
88
@app.get("/")
99
def home():
1010
return {"message": "Welcome to the Randomizer API"}
11-
12-
13-
@app.post("/items")
14-
def add_item(item: str):
15-
if not item.strip():
16-
raise HTTPException(status_code=400, detail="Item cannot be empty")
17-
18-
if item in items_db:
19-
raise HTTPException(status_code=400, detail="Item already exists")
20-
21-
items_db.append(item)
22-
return {
23-
"message": "Item added successfully",
24-
"item": item,
25-
"total_items": len(items_db),
26-
}

0 commit comments

Comments
 (0)