1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

edit organization

This commit is contained in:
Kyle Spearrin
2018-03-22 14:29:33 -04:00
parent 14039d7d1a
commit 6ecaaff94d
5 changed files with 584 additions and 4 deletions

View File

@ -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 });
}
}
}