|
|
@@ -6,7 +6,7 @@ from db.repository.fuelingtask import ( |
|
|
|
delete_fueling_task, |
|
|
|
get_fueling_task_by_id |
|
|
|
) |
|
|
|
from schemas.fuelingtask import CreateFuelingTask |
|
|
|
from schemas.fuelingtask import CreateFuelingTask, OutputFuelingTask |
|
|
|
from db.models.user import User |
|
|
|
from apis.v1.route_auth import get_current_user |
|
|
|
|
|
|
@@ -40,7 +40,7 @@ def create_fuelingtask( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/{fueling_task_id}", status_code=status.HTTP_200_OK) |
|
|
|
@router.get("/{fueling_task_id}", response_model=OutputFuelingTask, status_code=status.HTTP_200_OK) |
|
|
|
def get_fuelingtask( |
|
|
|
fueling_task_id: int, |
|
|
|
db: Session = Depends(get_db), |
|
|
@@ -50,8 +50,12 @@ def get_fuelingtask( |
|
|
|
raise HTTPException( |
|
|
|
status_code=403, detail="You are not authorized to perform this action" |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
fuelingtask = get_fueling_task_by_id(fueling_task_id, db) |
|
|
|
if fuelingtask == "notfound": |
|
|
|
raise HTTPException( |
|
|
|
status_code=404, detail="fuck off" |
|
|
|
) |
|
|
|
return fuelingtask |
|
|
|
|
|
|
|
@router.delete("/{fueling_task_id}", status_code=status.HTTP_204_NO_CONTENT) |
|
|
|