helpers/manageGarden.js
/**
 * Function to delete a garden
 * @param {int} id ID of the garden to be deleted
 * @returns {Promise<boolean>} Indicates, whether deleting the garden was successful
 */
Function to delete a garden
@param {int} id ID of the garden to be deleted
@returns {Promise} Indicates, whether deleting the garden was successful
Function to delete a garden @param { int } id ID of the garden to be deleted @returns { Promise } Indicates whether deleting the garden was successful
async function deleteGarden(id) {
  const deleteRequest = await fetch(deleteGardenUrl(id), {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    credentials: "include",
  });
  return new Promise((resolve, reject) => {
    if (deleteRequest.status == 200) {
      resolve(true);
    } else {
      reject(false);
    }
  });
}
async function deleteGarden ( id ) { const deleteRequest = await fetch ( deleteGardenUrl ( id ) , { method : "DELETE" , headers : { "Content-Type" : "application/json" , } , credentials : "include" , } ) ; return new Promise ( ( resolve , reject ) => { if ( deleteRequest . status == 200 ) { resolve ( true ) ; } else { reject ( false ) ; } } ) ; }
Function to delete a garden
 @param {int} id ID of the garden to be deleted
 @returns {Promise<boolean>} Indicates, whether deleting the garden was successful
Function to delete a garden @param { int } id ID of the garden to be deleted @returns { Promise<boolean > } Indicates whether deleting the garden was successful