Update delete_credential function to return status code 204
This commit is contained in:
parent
178db4b95f
commit
3b7cae829c
1 changed files with 1 additions and 2 deletions
|
|
@ -98,7 +98,7 @@ def update_credential(
|
|||
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||
|
||||
|
||||
@router.delete("/{credential_id}", response_model=CredentialRead, status_code=200)
|
||||
@router.delete("/{credential_id}", status_code=204)
|
||||
def delete_credential(
|
||||
*,
|
||||
session: Session = Depends(get_session),
|
||||
|
|
@ -114,6 +114,5 @@ def delete_credential(
|
|||
raise HTTPException(status_code=404, detail="Credential not found")
|
||||
session.delete(db_credential)
|
||||
session.commit()
|
||||
return db_credential
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue