Skip to content

Commit e8c7cfc

Browse files
Returning 204 response
1 parent 4685bb9 commit e8c7cfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/routers/customer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Any
22

3-
from fastapi import APIRouter
3+
from fastapi import APIRouter, status
44

55
from app.db.database_config import database
66
from app.model.customer import Customer
@@ -24,7 +24,8 @@ async def read_customers() -> list[Customer]:
2424
return customers
2525

2626

27-
@router.put("/customers/", tags=["users"])
27+
@router.put("/customers/", status_code=status.HTTP_204_NO_CONTENT, tags=["users"])
2828
async def insert_customers(customers: list[Customer]) -> None:
2929
rows: list[dict[str, Any]] = list(map(lambda customer: vars(customer), customers))
3030
await database.execute_many(query=INSERT_CUSTOMER, values=rows)
31+
return None

0 commit comments

Comments
 (0)