diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index 364cef05dafef52c97d0ff4aa366db79551b5da2..93d392a46081c152cce231815e07eb72f2bb2cec 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -403,6 +403,24 @@ function fillSenderLike(userWhoSubmitLike, formSenderLike, currentResource) { receiver_object_id } +/** + * Specific treatments for the request lists refresh + * @param {String} formId - Id of the sumitted form + * @param {String} listId - Id of the list to refresh + */ +async function refreshRequestList(formId, listId) { + let form = document.getElementById(formId); + form.addEventListener("save", async function() { + let list = document.getElementById(listId); + let listProxy = await list.component.resource + listProxy.clearCache(); + list.dataset.src = list.dataset.src; + setTimeout(() => { + manageAccordionForRequest(); + }, 1000); + }); +} + /** * For entrepreneur dashboard only : * As we cannot have multiple imbricated filtering with the native sib-display, we manage it manually. @@ -750,7 +768,7 @@ jQuery(document).ready(function($) { refreshList("mentor_profile_edition", "mentor_contact"); refreshList("mentor_profile_edition", "user_account_picture"); initFileUpload("mentor_profile_edition", "account.picture"); - refreshList("change_status_request", "request_list"); + refreshRequestList("change_status_request", "request_list"); addProperFilterToSearchComponents("entrepreneur-resource-list"); addProperFilterToSearchComponents("mentor-database");