Disallow multiple entries for the same role

This commit is contained in:
Jake Barnby committed 2022-08-29 15:20:33 +12:00
1 parent 33152c7bb1
commit 90dae04fb7
2 files changed
+5 -1

No files matched your search

@@ -91,7 +91,7 @@ $escapedPermissions = \array_map(function ($perm) {
<input
required
id="<?php echo $form; ?>"
id="<?php echo $form; ?>Input"
name="<?php echo $form; ?>"
form="<?php echo $form ?>"
list="types"
+4
View File
@@ -34,6 +34,10 @@
});
},
addPermission(formId, role, permissions) {
if (this.permissions.some(p => p.role === role)) {
document.getElementById(`${formId}Input`)
.setCustomValidity('Role entry already exists');
}
if (!document.getElementById(formId).reportValidity()) {
return;
}