aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/bootstrap/forms.js
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2025-11-19 08:23:15 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2025-11-19 08:23:15 +0000
commit91268e7072c5140c516b6725cc8e6525f4c4834e (patch)
treed75828425344181c1f2c2e1a63a7fc66f5d4108d /resources/assets/javascripts/bootstrap/forms.js
parent79a73b3c106d3de37b8a369fba7875238cf139af (diff)
Resolve "Nachricht beim erstellen eines Accounts fehlerhaft"
Closes #6059 Merge request studip/studip!4615
Diffstat (limited to 'resources/assets/javascripts/bootstrap/forms.js')
-rw-r--r--resources/assets/javascripts/bootstrap/forms.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/resources/assets/javascripts/bootstrap/forms.js b/resources/assets/javascripts/bootstrap/forms.js
index d22b15a..b80d845 100644
--- a/resources/assets/javascripts/bootstrap/forms.js
+++ b/resources/assets/javascripts/bootstrap/forms.js
@@ -369,14 +369,15 @@ STUDIP.ready(function () {
body: new URLSearchParams(params),
headers: {'X-Requested-With': 'XMLHttpRequest'}
}).then(response => response.json());
- notes.push(
- ...output.map(item => ({
+ if (output && typeof output === 'object') {
+ const validationErrors = Object.values(output).map(item => ({
name: item.name,
label: item.label,
description: item.error,
describedby: null
- }))
- );
+ }));
+ notes.push(...validationErrors);
+ }
}
// Resolve or reject based on present error notes
@@ -409,7 +410,7 @@ STUDIP.ready(function () {
for (let k in this.STUDIPFORM_VALIDATIONNOTES) {
if (this.STUDIPFORM_VALIDATIONNOTES[k].name === this.STUDIPFORM_INPUTS_ORDER[i]) {
orderedNotes.push(this.STUDIPFORM_VALIDATIONNOTES[k]);
- inserted.push(k);
+ inserted.push(Number(k));
}
}
}