mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
edit organization
This commit is contained in:
@ -44,5 +44,30 @@ namespace Bit.Admin.Controllers
|
||||
Count = count
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> Edit(Guid id)
|
||||
{
|
||||
var organization = await _organizationRepository.GetByIdAsync(id);
|
||||
if(organization == null)
|
||||
{
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
return View(new OrganizationEditModel(organization));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> Edit(Guid id, OrganizationEditModel model)
|
||||
{
|
||||
var organization = await _organizationRepository.GetByIdAsync(id);
|
||||
if(organization == null)
|
||||
{
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
model.ToOrganization(organization);
|
||||
await _organizationRepository.ReplaceAsync(organization);
|
||||
return RedirectToAction("Edit", new { id });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user