1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-06 18:43:25 +00:00

[AC-2634] Add device-approvals approve command (#9476)

This commit is contained in:
Thomas Rittson
2024-06-04 08:26:53 +10:00
committed by GitHub
parent edecec56de
commit e99fd44eed
2 changed files with 56 additions and 7 deletions

View File

@@ -49,14 +49,18 @@ export class DeviceApprovalProgram extends BaseProgram {
private approveCommand(): Command {
return new Command("approve")
.argument("<id>")
.argument("<organizationId>", "The id of the organization")
.argument("<requestId>", "The id of the request to approve")
.description("Approve a pending request")
.action(async (id: string) => {
.action(async (organizationId: string, id: string) => {
await this.exitIfFeatureFlagDisabled(FeatureFlag.BulkDeviceApproval);
await this.exitIfLocked();
const cmd = new ApproveCommand();
const response = await cmd.run(id);
const cmd = new ApproveCommand(
this.serviceContainer.organizationService,
this.serviceContainer.organizationAuthRequestService,
);
const response = await cmd.run(organizationId, id);
this.processResponse(response);
});
}