mirror of
https://github.com/Significant-Gravitas/Auto-GPT.git
synced 2025-01-09 04:19:02 +08:00
fix(backend): Deactivate graph on delete (#8947)
- Resolves #8945 ### Changes 🏗️ - Call `on_graph_deactivate` on current active version in `DELETE /api/graphs/{graph_id}` endpoint
This commit is contained in:
parent
b16bf42fa3
commit
abf73e8d66
@ -249,6 +249,13 @@ async def do_create_graph(
|
||||
async def delete_graph(
|
||||
graph_id: str, user_id: Annotated[str, Depends(get_user_id)]
|
||||
) -> DeleteGraphResponse:
|
||||
if active_version := await graph_db.get_graph(graph_id, user_id=user_id):
|
||||
|
||||
def get_credentials(credentials_id: str) -> "Credentials | None":
|
||||
return integration_creds_manager.get(user_id, credentials_id)
|
||||
|
||||
await on_graph_deactivate(active_version, get_credentials)
|
||||
|
||||
return {"version_counts": await graph_db.delete_graph(graph_id, user_id=user_id)}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user