From 3b7cae829ced943dafc4ab6000d17b48fbc6dd1a Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 21 Mar 2024 13:58:26 -0300 Subject: [PATCH] Update delete_credential function to return status code 204 --- src/backend/langflow/api/v1/credential.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend/langflow/api/v1/credential.py b/src/backend/langflow/api/v1/credential.py index ff53d5e1a..836a2629e 100644 --- a/src/backend/langflow/api/v1/credential.py +++ b/src/backend/langflow/api/v1/credential.py @@ -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