Madiwka3 pirms 1 gada
vecāks
revīzija
44405f2cea
2 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. +8
    -0
      app/apis/v1/route_maintenancejob.py
  2. +1
    -1
      app/db/repository/maintenancejob.py

+ 8
- 0
app/apis/v1/route_maintenancejob.py Parādīt failu

@@ -103,4 +103,12 @@ def change_status(
result = change_maintenance_status(maintenance_job_id, status, current_user.Id, db)
if result is None:
raise HTTPException(status_code=404, detail="Maintenance job not found")
if result == "alreadydone":
raise HTTPException(
status_code=400, detail="This maintenance job is already done"
)
if result == "invalidstatus":
raise HTTPException(
status_code=400, detail="Invalid status, please use 'Complete'"
)
return result

+ 1
- 1
app/db/repository/maintenancejob.py Parādīt failu

@@ -121,4 +121,4 @@ def change_maintenance_status(
db.refresh(maintenancejob)
return maintenancejob
else:
return None
return "invalidstatus"

Notiek ielāde…
Atcelt
Saglabāt