Bugfixing
This commit is contained in:
@@ -37,7 +37,7 @@ useEventsStore().fetchFlightsTracks({
|
||||
totalTime.value += flightTrack.durationMinCalculated;
|
||||
|
||||
if (flightTrack.track) {
|
||||
tracks.value.push(flightTrack.track.coordinates);
|
||||
tracks.value.push(flightTrack.track.points.coordinates);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -25,10 +25,12 @@ query eventsFlightsTracks($eventId: Int, $eventUrlSlug: String, $onlyPublic: Boo
|
||||
event(id: $eventId, urlSlug: $eventUrlSlug, public: $onlyPublic) {
|
||||
flights(onlyPublic: $onlyPublic) {
|
||||
durationMinCalculated
|
||||
tracks {
|
||||
coordinates {
|
||||
lat
|
||||
lng
|
||||
track {
|
||||
points {
|
||||
coordinates {
|
||||
lat
|
||||
lng
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
<script setup>
|
||||
import {reactive, ref} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {useMeta, useQuasar} from "quasar";
|
||||
import {errorObject, successObject} from "src/composables/dialog";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {isRequired, isValidEmail, minLength} from "src/composables/form/rules";
|
||||
import {isRequired, isValidEmail} from "src/composables/form/rules";
|
||||
import {api} from "boot/axios";
|
||||
import {useAuthStore} from "stores/Auth";
|
||||
import {metaData} from "src/composables/meta";
|
||||
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
|
||||
useAppStore().setPageTitle("Zapomenuté heslo");
|
||||
@@ -18,19 +15,21 @@ useMeta(() => metaData({
|
||||
index: false
|
||||
}));
|
||||
|
||||
const requestPasswordChange = () => {
|
||||
const requestPasswordChange = async () => {
|
||||
if (!form.value.validate()) return;
|
||||
|
||||
return api.post('/forgotten-password/request', formData).then(response => {
|
||||
$q.notify(successObject("Žádost o změnu hesla odeslána, zkontroluj si svůj e-mail."))
|
||||
}).catch(({response}) => {
|
||||
try {
|
||||
await api.post('/forgotten-password/request', formData);
|
||||
$q.notify(successObject("Žádost o změnu hesla odeslána, zkontroluj si svůj e-mail."));
|
||||
} catch (e) {
|
||||
const {response} = e;
|
||||
if (response.status === 404) {
|
||||
$q.notify(errorObject(`E-mail ${formData.email} není registrovaný.`));
|
||||
} else {
|
||||
console.error(response)
|
||||
$q.notify(errorObject("Při odesílání se stala chyba. Zkus to za chvíli znovu."));
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const form = ref(null);
|
||||
@@ -49,39 +48,42 @@ const rules = {
|
||||
<q-page-container>
|
||||
|
||||
<q-page class="row justify-center">
|
||||
<q-card flat square style="width:95%; max-width: 450px; height: 500px">
|
||||
<q-card-section class="bg-primary">
|
||||
<h4 class="text-h5 text-white q-my-md">Zapomenuté heslo</h4>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-form
|
||||
ref="form"
|
||||
class="q-px-sm q-pt-xl q-pb-lg"
|
||||
@submit.prevent="requestPasswordChange"
|
||||
>
|
||||
|
||||
<q-input square clearable v-model="formData.email" type="email" label="E-mail" :rules="rules.email">
|
||||
<q-form
|
||||
ref="form"
|
||||
class="q-px-sm q-pt-xl q-pb-lg"
|
||||
style="width:95%; max-width: 450px; height: 500px"
|
||||
@submit.prevent="requestPasswordChange"
|
||||
>
|
||||
|
||||
<q-card flat square>
|
||||
<q-card-section class="bg-primary">
|
||||
<h4 class="text-h5 text-white q-my-md">Zapomenuté heslo</h4>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-input v-model="formData.email" type="email" label="E-mail" :rules="rules.email">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="email"/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
<q-card-actions class="q-px-lg">
|
||||
<q-btn
|
||||
@click="requestPasswordChange"
|
||||
unelevated
|
||||
size="lg"
|
||||
color="primary"
|
||||
class="full-width"
|
||||
label="Resetovat heslo"
|
||||
/>
|
||||
</q-card-actions>
|
||||
<q-card-section class="text-center q-pa-sm">
|
||||
<router-link :to="{name: 'login'}" class="text-grey-6">Zpět na login</router-link>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-card-section>
|
||||
<q-card-actions>
|
||||
<q-btn
|
||||
@click="requestPasswordChange"
|
||||
unelevated
|
||||
size="lg"
|
||||
color="primary"
|
||||
class="full-width"
|
||||
label="Resetovat heslo"
|
||||
/>
|
||||
</q-card-actions>
|
||||
<q-card-section class="text-center q-pa-sm">
|
||||
<router-link :to="{name: 'login'}" class="text-grey-6">Zpět na login</router-link>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-form>
|
||||
|
||||
</q-page>
|
||||
</q-page-container>
|
||||
</q-layout>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import {reactive, ref} from "vue";
|
||||
import {reactive} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {isRequired, isValidEmail, minLength} from "src/composables/form/rules";
|
||||
import {useMeta, useQuasar} from "quasar";
|
||||
@@ -40,33 +40,33 @@ const formData = reactive({
|
||||
<q-page-container>
|
||||
|
||||
<q-page class="window-height window-width row justify-center">
|
||||
<q-card square flat style="width:95%; max-width: 450px;" class="q-mt-lg">
|
||||
<q-card-section class="bg-primary">
|
||||
<h4 class="text-h5 q-my-md text-white">Login</h4>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-form class="q-px-sm q-pt-xl" @submit.prevent="logUser()">
|
||||
<q-input square clearable v-model="formData.email" :rules="rules.email" type="email" label="E-mail">
|
||||
<q-form class="q-px-sm q-pt-xl" style="width:95%; max-width: 450px;" @submit.prevent="logUser()">
|
||||
|
||||
<q-card square flat class="q-mt-lg">
|
||||
<q-card-section class="bg-primary">
|
||||
<h4 class="text-h5 q-my-md text-white">Login</h4>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-input v-model="formData.email" :rules="rules.email" type="email" label="E-mail">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="email"/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input square clearable v-model="formData.password" :rules="rules.password" type="password" label="Password">
|
||||
<q-input v-model="formData.password" :rules="rules.password" type="password" label="Heslo">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="lock"/>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions class="q-px-lg">
|
||||
<q-btn unelevated size="lg" color="primary" class="full-width" label="Přihlásit se" @click.prevent="logUser()"/>
|
||||
</q-card-actions>
|
||||
<q-card-section class="text-center q-pa-sm">
|
||||
<router-link :to="{name: 'forgottenPassword'}" class="text-grey-6">Zapomenuté heslo</router-link>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions>
|
||||
<q-btn type="submit" unelevated size="lg" color="primary" class="full-width" label="Přihlásit se" @click.prevent="logUser()"/>
|
||||
</q-card-actions>
|
||||
<q-card-section class="text-center q-pa-sm">
|
||||
<router-link :to="{name: 'forgottenPassword'}" class="text-grey-6">Zapomenuté heslo</router-link>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-form>
|
||||
</q-page>
|
||||
</q-page-container>
|
||||
</q-layout>
|
||||
|
||||
@@ -53,37 +53,38 @@ const rules = {
|
||||
<q-layout view="lHh Lpr lFf">
|
||||
<q-page-container>
|
||||
<q-page class="row justify-center">
|
||||
<q-card flat style="width: 100%; max-width: 450px">
|
||||
<q-form
|
||||
ref="form"
|
||||
class="q-px-sm q-pt-xl q-pb-lg"
|
||||
style="width: 100%; max-width: 450px"
|
||||
@submit.prevent="registerUser"
|
||||
>
|
||||
<q-card flat>
|
||||
<q-card-section class="bg-primary">
|
||||
<h4 class="text-h5 text-white q-my-md">Registrace</h4>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-form
|
||||
ref="form"
|
||||
class="q-px-sm q-pt-xl q-pb-lg"
|
||||
@submit.prevent="registerUser"
|
||||
>
|
||||
<q-input square clearable v-model="formData.name" type="text" label="Jméno">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="person"/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input v-model="formData.name" type="text" label="Jméno">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="person"/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-input square clearable v-model="formData.email" type="email" label="E-mail" :rules="rules.email">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="email"/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input square clearable v-model="formData.password" type="password" label="Heslo" :rules="rules.password">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="lock"/>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-form>
|
||||
<q-input v-model="formData.email" type="email" label="E-mail" :rules="rules.email">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="email"/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input v-model="formData.password" type="password" label="Heslo" :rules="rules.password">
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="lock"/>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-card-section>
|
||||
<q-card-actions class="q-px-lg">
|
||||
<q-card-actions>
|
||||
<q-btn
|
||||
@click="registerUser"
|
||||
type="submit"
|
||||
unelevated
|
||||
color="primary"
|
||||
size="lg"
|
||||
@@ -95,6 +96,8 @@ const rules = {
|
||||
<router-link :to="{name: 'login'}" class="text-grey-6">Zpět na login</router-link>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-form>
|
||||
|
||||
</q-page>
|
||||
</q-page-container>
|
||||
</q-layout>
|
||||
|
||||
Reference in New Issue
Block a user