Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sebader committed Sep 30, 2023
1 parent e83ed94 commit 3f4bd7b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions website/src/components/MapPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<label>{{ $t('message.hutfullNotify') }}</label>
<br />
<input type="email" id="email" v-model="email" placeholder="Email" required />
<button @click="submitNotificationForm(hut.id, email)">{{ $t('message.submit') }}</button>
<button @click="submitNotificationForm(hut.id)">{{ $t('message.submit') }}</button>
</div>
<div v-else>
<p>{{ $t('message.formSuccessfullySubmitted') }}</p>
Expand Down Expand Up @@ -254,30 +254,29 @@ export default {
sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
},
async submitNotificationForm(hutId, emailAddress) {
async submitNotificationForm(hutId) {
try {
// Perform AJAX request using Fetch API
let response = await fetch(`/api/freebednotification/${hutId}`, {
await fetch(`/api/freebednotification/${hutId}`, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
emailAddress: emailAddress,
emailAddress: this.email,
date: this.dateFilter
})
});
console.log("Form submitted successfully!");
// Handle the response data as needed
//console.log("Form submitted successfully!");
this.formSubmitted = true; // Set formSubmitted to true on successful submission
} catch (error) {
console.error("Error submitting form:", error);
// Handle errors
}
},
onPopupClose() {
console.log("Popup closed");
// Reset formSubmitted to false when popup is closed
this.formSubmitted = false;
}
},
Expand Down

0 comments on commit 3f4bd7b

Please sign in to comment.