mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
feat(backend): renamed endpoints for consistency
This commit is contained in:
@@ -27,7 +27,7 @@ def _to_read_model(tx: Transaction) -> TransactionRead:
|
||||
)
|
||||
|
||||
|
||||
@router.post("/", response_model=TransactionRead, status_code=status.HTTP_201_CREATED)
|
||||
@router.post("/create", response_model=TransactionRead, status_code=status.HTTP_201_CREATED)
|
||||
async def create_transaction(
|
||||
payload: TransactionCreate,
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
@@ -88,7 +88,7 @@ async def get_transaction(
|
||||
return _to_read_model(tx)
|
||||
|
||||
|
||||
@router.patch("/{transaction_id}", response_model=TransactionRead)
|
||||
@router.patch("/{transaction_id}/edit", response_model=TransactionRead)
|
||||
async def update_transaction(
|
||||
transaction_id: int,
|
||||
payload: TransactionUpdate,
|
||||
@@ -130,7 +130,7 @@ async def update_transaction(
|
||||
return _to_read_model(tx)
|
||||
|
||||
|
||||
@router.delete("/{transaction_id}", status_code=status.HTTP_204_NO_CONTENT)
|
||||
@router.delete("/{transaction_id}/delete", status_code=status.HTTP_204_NO_CONTENT)
|
||||
async def delete_transaction(
|
||||
transaction_id: int,
|
||||
session: AsyncSession = Depends(get_async_session),
|
||||
|
||||
Reference in New Issue
Block a user