diff --git a/_dev/js/theme/core/cart/handler/voucher/codeLinkSubmitHandler.js b/_dev/js/theme/core/cart/handler/voucher/codeLinkSubmitHandler.js index de74634d..14086bad 100644 --- a/_dev/js/theme/core/cart/handler/voucher/codeLinkSubmitHandler.js +++ b/_dev/js/theme/core/cart/handler/voucher/codeLinkSubmitHandler.js @@ -1,6 +1,9 @@ /** - * Submit voucher code from link - * @param event {object} - click event + * Handles the submission of a voucher code from a link. + * @param {Event} event - The click event that triggered the submission. + * @param {HTMLElement} event.delegateTarget - The target element that was clicked. + * @throws {Error} Will throw an error if the required elements are not found. + * @returns {void} */ const codeLinkSubmitHandler = (event) => { event.preventDefault(); diff --git a/_dev/js/theme/core/cart/handler/voucher/deleteVoucherHandler.js b/_dev/js/theme/core/cart/handler/voucher/deleteVoucherHandler.js index d3dbbb30..3a7fd742 100644 --- a/_dev/js/theme/core/cart/handler/voucher/deleteVoucherHandler.js +++ b/_dev/js/theme/core/cart/handler/voucher/deleteVoucherHandler.js @@ -2,9 +2,11 @@ import prestashop from 'prestashop'; import deleteVoucherFromCartRequest from '../../request/voucher/deleteVoucherFromCartRequest'; /** - * Delete voucher handler - * @param event {object} - click event - * @returns {Promise} + * Handles the deletion of a voucher from the cart. + * @param {Event} event - The click event that triggered the deletion. + * @param {HTMLElement} event.delegateTarget - The target element that was clicked. + * @throws {Error} Will throw an error if required data is missing or if an error occurs during the deletion process. + * @returns {Promise} - A Promise that resolves once the deletion process is complete. */ const deleteVoucherHandler = async (event) => { event.preventDefault(); diff --git a/_dev/js/theme/core/cart/handler/voucher/submitVoucherHandler.js b/_dev/js/theme/core/cart/handler/voucher/submitVoucherHandler.js index 46708814..9ef4dbcf 100644 --- a/_dev/js/theme/core/cart/handler/voucher/submitVoucherHandler.js +++ b/_dev/js/theme/core/cart/handler/voucher/submitVoucherHandler.js @@ -3,9 +3,11 @@ import addVoucherToCartRequest from '../../request/voucher/addVoucherToCartReque import parseToHtml from '../../../../utils/parseToHtml'; /** - * Submit voucher handler - * @param event {object} - submit event - * @returns {Promise} + * Handles the submission of a voucher form and updates the cart accordingly. + * @param {Event} event - The submit event that triggered the voucher submission. + * @param {HTMLElement} event.delegateTarget - The form element that was submitted. + * @throws {Error} Will throw an error if required data is missing or if an error occurs during the submission process. + * @returns {Promise} - A Promise that resolves once the submission process is complete. */ const submitVoucherHandler = async (event) => { event.preventDefault();