summaryrefslogtreecommitdiff
path: root/web-client
diff options
context:
space:
mode:
Diffstat (limited to 'web-client')
-rw-r--r--web-client/voll/src/components/AppointmentModal.vue1
-rw-r--r--web-client/voll/src/components/AppointmentsList.vue9
-rw-r--r--web-client/voll/src/router/index.ts2
-rw-r--r--web-client/voll/src/views/AuthenticationView.vue (renamed from web-client/voll/src/views/AuthView.vue)7
-rw-r--r--web-client/voll/src/views/HomeView.vue6
5 files changed, 20 insertions, 5 deletions
diff --git a/web-client/voll/src/components/AppointmentModal.vue b/web-client/voll/src/components/AppointmentModal.vue
index 451c039..0b06f3b 100644
--- a/web-client/voll/src/components/AppointmentModal.vue
+++ b/web-client/voll/src/components/AppointmentModal.vue
@@ -76,6 +76,7 @@ export default defineComponent({
}
}).then(response => {
console.log(response)
+ this.$emit('list')
}).catch(error => {
console.log(error)
})
diff --git a/web-client/voll/src/components/AppointmentsList.vue b/web-client/voll/src/components/AppointmentsList.vue
index 3a6623b..0e17319 100644
--- a/web-client/voll/src/components/AppointmentsList.vue
+++ b/web-client/voll/src/components/AppointmentsList.vue
@@ -23,7 +23,7 @@
</div>
</li>
</ul>
- <AppointmentModal ref="modal" :page="page" />
+ <AppointmentModal ref="modal" :page="page" @list="list"/>
</template>
<script lang="ts">
@@ -34,6 +34,7 @@ import ButtonReverse from './ButtonReverse.vue';
import AppointmentModal from './AppointmentModal.vue';
import Search from './Search.vue';
import IAppointment from '@/interfaces/IAppointment';
+import handleBadRequest from '@/utilities/handleBadRequest';
export default defineComponent({
@@ -76,6 +77,9 @@ export default defineComponent({
})
}).catch(error => {
console.log(error)
+ const code = error.response.status
+ const errors = error.response.data
+ this.handleBadRequest(code, errors)
})
},
handleForbidden(code) {
@@ -86,7 +90,8 @@ export default defineComponent({
},
showModal(appointment) {
(this.$refs.modal as typeof AppointmentModal).showModal(appointment)
- }
+ },
+ handleBadRequest
},
created() {
this.list()
diff --git a/web-client/voll/src/router/index.ts b/web-client/voll/src/router/index.ts
index f3c9026..a9c20c6 100644
--- a/web-client/voll/src/router/index.ts
+++ b/web-client/voll/src/router/index.ts
@@ -1,6 +1,6 @@
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
-import LoginView from '../views/AuthView.vue'
+import LoginView from '../views/AuthenticationView.vue'
import DoctorsView from '../views/DoctorsView.vue'
import PatientsView from '../views/PatientsView.vue'
import AppointmentsView from '../views/AppointmentsView.vue'
diff --git a/web-client/voll/src/views/AuthView.vue b/web-client/voll/src/views/AuthenticationView.vue
index a7b52d1..a01b869 100644
--- a/web-client/voll/src/views/AuthView.vue
+++ b/web-client/voll/src/views/AuthenticationView.vue
@@ -9,7 +9,7 @@
<Fieldset>
<label class="field-label" for="password">Password</label>
<input type="password" class="field-input margin-top" id="password" v-model="password" required/>
- <span class="error-message"></span>
+ <span ref="invalid" class="error-message"></span>
</Fieldset>
<div class="margin-top">
<Button @click.prevent="login()" Value="Sign In" Class="btn form-btn" Id="send" Type="submit" />
@@ -47,12 +47,17 @@ export default defineComponent({
password: this.password
})
.then(response => {
+ (this.$refs.invalid as HTMLElement).innerHTML = ''
sessionStorage.setItem("token", response.data.token)
this.$router.push('/')
})
.catch(error => {
const errors = error.response.data
const code = error.response.status
+ console.log(code)
+ if (code === 403) {
+ (this.$refs.invalid as HTMLElement).innerHTML = 'Invalid email or password'
+ }
this.handleBadRequest(code, errors)
})
},
diff --git a/web-client/voll/src/views/HomeView.vue b/web-client/voll/src/views/HomeView.vue
index 776e83c..292c26b 100644
--- a/web-client/voll/src/views/HomeView.vue
+++ b/web-client/voll/src/views/HomeView.vue
@@ -1,6 +1,6 @@
<template>
<Header />
- <main class="container">
+ <main class="container margin-top">
<Logo Class="logo-huge" />
<Title text="Managing your clinic" Class="title"/>
<p>Choose in which session you want to start:</p>
@@ -69,6 +69,10 @@ export default defineComponent({
font-size: 3rem;
}
+.margin-top {
+ margin-top: 2rem;
+}
+
@media screen and (max-width: 900px) {
.cards {
flex-direction: column;