aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/bootstrap/consultations.js
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-28 08:47:35 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-28 08:47:35 +0000
commit0afb9c16eab3f9c1fd069b350d4fa9fee4c0ec73 (patch)
treee68d8b304a4bcae48510b4454f740a839059ee8e /resources/assets/javascripts/bootstrap/consultations.js
parentfe2b584cb79ba8a2c642be085cacdd82d526df25 (diff)
allow abstract api to work with real promises instead of deferreds and use it, fixes #3643
Closes #3643 Merge request studip/studip!2885
Diffstat (limited to 'resources/assets/javascripts/bootstrap/consultations.js')
-rw-r--r--resources/assets/javascripts/bootstrap/consultations.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/resources/assets/javascripts/bootstrap/consultations.js b/resources/assets/javascripts/bootstrap/consultations.js
index ef79d9c..51ffa85 100644
--- a/resources/assets/javascripts/bootstrap/consultations.js
+++ b/resources/assets/javascripts/bootstrap/consultations.js
@@ -10,9 +10,9 @@ $(document).on('click', '.consultation-delete-check:not(.ignore)', event => {
}
let requests = ids.map(id => {
- return STUDIP.jsonapi.GET(`consultation-slots/${id}/bookings`).then(result => result.data.length);
+ return STUDIP.jsonapi.withPromises().get(`consultation-slots/${id}/bookings`).then(response => response.data.length);
});
- $.when(...requests).done((...results) => {
+ Promise.all(requests).then((...results) => {
if (results.some(result => result > 0)) {
$(event.target).addClass('ignore').click().removeClass('ignore');
} else {