Skip to content

Commit 900128a

Browse files
committed
Add Update endpoint to OrganizationInviteLinksController
- Implemented the Update method in OrganizationInviteLinksController to handle updates for organization invite links. - The method utilizes the IUpdateOrganizationInviteLinkCommand to process update requests and returns the appropriate response model. - Enhanced the controller's functionality to support invite link modifications, ensuring better management of organization invite links.
1 parent 97aa709 commit 900128a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/Api/AdminConsole/Controllers/OrganizationInviteLinksController.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace Bit.Api.AdminConsole.Controllers;
1515
[RequireFeature(FeatureFlagKeys.GenerateInviteLink)]
1616
public class OrganizationInviteLinksController(
1717
ICreateOrganizationInviteLinkCommand createOrganizationInviteLinkCommand,
18-
IGetOrganizationInviteLinkQuery getOrganizationInviteLinkQuery)
18+
IGetOrganizationInviteLinkQuery getOrganizationInviteLinkQuery,
19+
IUpdateOrganizationInviteLinkCommand updateOrganizationInviteLinkCommand)
1920
: BaseAdminConsoleController
2021
{
2122
[HttpGet("")]
@@ -40,4 +41,15 @@ public async Task<IResult> Create(Guid orgId, [FromBody] CreateOrganizationInvit
4041
$"organizations/{orgId}/invite-link",
4142
new OrganizationInviteLinkResponseModel(link)));
4243
}
44+
45+
[HttpPut("")]
46+
[Authorize<ManageUsersRequirement>]
47+
public async Task<IResult> Update(Guid orgId, [FromBody] UpdateOrganizationInviteLinkRequestModel model)
48+
{
49+
var result = await updateOrganizationInviteLinkCommand.UpdateAsync(
50+
model.ToCommandRequest(orgId));
51+
52+
return Handle(result, link =>
53+
TypedResults.Ok(new OrganizationInviteLinkResponseModel(link)));
54+
}
4355
}

0 commit comments

Comments
 (0)