Skip to content

Commit

Permalink
js docs improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksydan committed Oct 22, 2023
1 parent 09fddf0 commit 2fd8850
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import prestashop from 'prestashop';
import deleteVoucherFromCartRequest from '../../request/voucher/deleteVoucherFromCartRequest';

/**
* Delete voucher handler
* @param event {object} - click event
* @returns {Promise<void>}
* 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<void>} - A Promise that resolves once the deletion process is complete.
*/
const deleteVoucherHandler = async (event) => {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>}
* 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<void>} - A Promise that resolves once the submission process is complete.
*/
const submitVoucherHandler = async (event) => {
event.preventDefault();
Expand Down

0 comments on commit 2fd8850

Please sign in to comment.