|
@@ -103,4 +103,12 @@ def change_status( |
|
|
result = change_maintenance_status(maintenance_job_id, status, current_user.Id, db) |
|
|
result = change_maintenance_status(maintenance_job_id, status, current_user.Id, db) |
|
|
if result is None: |
|
|
if result is None: |
|
|
raise HTTPException(status_code=404, detail="Maintenance job not found") |
|
|
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 |
|
|
return result |