diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..0c33b57
--- /dev/null
+++ b/.env.development
@@ -0,0 +1 @@
+VUE_APP_API_URL=http://localhost:1234/api/
\ No newline at end of file
diff --git a/.env.production b/.env.production
new file mode 100644
index 0000000..f3a3d2e
--- /dev/null
+++ b/.env.production
@@ -0,0 +1 @@
+VUE_APP_API_URL=https://reservation.ck.si/api/
\ No newline at end of file
diff --git a/README.md b/README.md
index b9fe7dc..6a07ae7 100644
--- a/README.md
+++ b/README.md
@@ -22,3 +22,8 @@ npm run lint
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
+
+### deploy
+```
+npm run build --mode=production && scp -r dist/* redplanet@dagobert:/home/redplanet/htdocs/reservation.ck.si/frontend
+```
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index 348cb37..4af672b 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -21,7 +21,7 @@ const routes = [
]
const router = new VueRouter({
- mode: 'history',
+ mode: 'hash',
base: process.env.BASE_URL,
routes
})
diff --git a/src/views/Cancel.vue b/src/views/Cancel.vue
index 8a8c469..673d37c 100644
--- a/src/views/Cancel.vue
+++ b/src/views/Cancel.vue
@@ -2,7 +2,7 @@
cancelling reservation {{$route.params.token}} ...
- Your reservation got cancelled.
+ your reservation got cancelled.
thanks for letting us know!
@@ -38,7 +38,7 @@
token: this.$route.params.token
}
const response = await fetch(
- `http://localhost:1234/api/guest/cancel`, {
+ `${process.env.VUE_APP_API_URL}guest/cancel`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 1eb840c..5df1e96 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -14,7 +14,10 @@
stay informed
-->
-
oh no something went wrong!
+
+ oh no something went wrong!
+ {{errorReason.detail}}
+
*robot voice* give us your data for the reservation!
@@ -33,74 +36,19 @@
TEXT!
-->
+
+
+
@@ -121,6 +69,7 @@
selectionText: null,
success: false,
error: false,
+ errorReason: null,
}
},
components: {
@@ -150,10 +99,13 @@
// return g
// })
// }
+ canShare () {
+ return !!navigator.share
+ }
},
methods: {
async fetchGuests() {
- const response = await fetch('/api/guest')
+ const response = await fetch(`${process.env.VUE_APP_API_URL}guest`)
const data = await response.json()
this.guests = data
},
@@ -171,7 +123,7 @@
newsletter: false,
}
const response = await fetch(
- '/api/guest', {
+ `${process.env.VUE_APP_API_URL}guest`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -186,12 +138,10 @@
this.success = true
this.fetchGuests()
} else {
- this.anzeigename = ''
- this.name = ''
- this.email = ''
- this.success = true
+ this.success = false
this.fetchGuests()
- // this.error = true
+ this.error = true
+ this.errorReason = await response.json()
}
this.sending = false
return false
@@ -204,7 +154,6 @@
},
async share () {
location.href = "#";
- location.href = "#teilnehmen";
try {
await navigator.share({ url:"https://reservation.ck.si/" })
} catch (err) {
@@ -221,6 +170,7 @@
this.selectionText = this.selection.toString()
}
});
+
// this.$refs.details.$el
},
}
@@ -278,9 +228,8 @@
}
.input-btn:hover {
- color: rgb(87, 87, 87);
- background: rgb(255, 255, 255);
- border-top: 2px solid rgb(207, 207, 207);
+ color: #fff;
+ background: #3260eb;
}
.input-checkbox {
@@ -325,7 +274,13 @@
padding: 3%;
}
-
+ .share {
+ max-width: 30em;
+ mix-blend-mode: soft-light;
+ }
+ .share:hover {
+ mix-blend-mode: difference;
+ }
.selection-text {
position: fixed;