fix(cli-node): keep every result in entity delete, not just the last (#5970)

This commit is contained in:
Abhay Singh
2026-06-29 15:26:57 +05:30
committed by GitHub
parent 4c0ea22d31
commit 31cec11a79
2 changed files with 58 additions and 4 deletions
+6 -4
View File
@@ -316,16 +316,18 @@ export class PlatformBackend implements Backend {
if (entities.length === 0) {
throw new Error("At least one entity ID is required for deleteEntities.");
}
// Delete each provided entity via the v2 path-based endpoint
let result: Record<string, unknown> = {};
// Delete each provided entity via the v2 path-based endpoint. Key each
// response by entity type so a multi-entity delete (e.g. --user-id and
// --agent-id together) doesn't discard everything but the last result.
const results: Record<string, unknown> = {};
for (const [entityType, entityId] of entities) {
result = (await this._request(
results[entityType] = (await this._request(
"DELETE",
`/v2/entities/${entityType}/${entityId}/`,
{ params: { source: "CLI" } },
)) as Record<string, unknown>;
}
return result;
return results;
}
async ping(): Promise<Record<string, unknown>> {