Fixed renaming group identifier not working

This commit is contained in:
2025-11-09 20:28:46 +01:00
parent 3fd16114c9
commit 1b95cf4d3b

View File

@@ -383,10 +383,10 @@ document.addEventListener('DOMContentLoaded', () => {
const updateButtons = document.querySelectorAll('.btn-update');
const updateModal = document.getElementById('updateGroupModal');
const updateForm = document.getElementById('updateGroupForm');
var groupId;
updateModal.addEventListener('show.bs.modal', async event => {
const button = event.relatedTarget;
const groupId = button.getAttribute('data-group-id');
groupId = button.getAttribute('data-group-id');
updateForm.reset();
@@ -441,6 +441,10 @@ document.addEventListener('DOMContentLoaded', () => {
jsonData.Description.Permissions = permissions;
jsonData.Description.DisplayName = jsonData.DisplayName;
jsonData.DisplayName = null;
jsonData.NewCn = jsonData.Cn;
jsonData.Cn = groupId;
buttons = $(`button[data-group-id=\"${jsonData.Cn}\"]`);
buttons.each(i => buttons[i].setAttribute("data-group-id", jsonData.NewCn));
try {
const response = await fetch('/Groups/Update', {
method: 'PATCH',