Improve user delete flow

This commit is contained in:
Urtzi Alfaro
2025-08-02 17:09:53 +02:00
parent 277e8bec73
commit 3681429e11
10 changed files with 1334 additions and 210 deletions

View File

@@ -140,7 +140,7 @@ class AuthTrainingServiceClient(BaseServiceClient):
"""Cancel all active training jobs for a tenant"""
try:
data = {"tenant_id": tenant_id}
return await self.post("jobs/cancel-tenant", data=data)
return await self.post("/tenants/{tenant_id}/training/jobs/cancel", data=data)
except Exception as e:
logger.error("Failed to cancel tenant training jobs",
tenant_id=tenant_id,
@@ -151,7 +151,7 @@ class AuthTrainingServiceClient(BaseServiceClient):
"""Get all active training jobs for a tenant"""
try:
params = {"status": "running,queued,pending", "tenant_id": tenant_id}
result = await self.get("jobs", params=params)
result = await self.get("/tenants/{tenant_id}/training/jobs/active", params=params)
return result.get("jobs", []) if result else []
except Exception as e:
logger.error("Failed to get tenant active jobs",