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