Homepage, verejna cast, vetsi sada uprav a oprav

This commit is contained in:
Michal Kváček
2023-08-21 22:45:58 +02:00
parent 8bc477a611
commit 8c3b8d19dd
54 changed files with 550 additions and 372 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ export const isValidEmail = (email) => {
return !!patternEmail.test(email) || "Tento e-mail není platný";
};
export const minLength = (length) => (val) => val.length >= length || `Zadej alespoň ${length} znaky`
export const maxLength = (length) => (val) => val.length < length || `Zadej maximálně ${length} znaků`
export const maxLength = (length) => (val) => val.length <= length || `Zadej maximálně ${length} znaků`
export const isEmptyArray = () => (val) => {
+2 -2
View File
@@ -28,9 +28,9 @@ export const fetchFlight = (flightId, username) => {
export const flights = storeToRefs(useFlightsStore()).items;
export const fetchFlights = () => {
export const fetchFlights = (username = null) => {
loading.value = true;
useFlightsStore().fetch().finally(() => {
useFlightsStore().fetch(username).finally(() => {
loading.value = false;
});
};
+14
View File
@@ -0,0 +1,14 @@
import {ref} from "vue";
import {useUserStore} from "stores/User";
export const loading = ref(true);
export const user = ref(null);
export const fetchUser = (username) => {
loading.value = true;
return useUserStore().fetchDetail(username)
.then(respUser => {
user.value = respUser;
return respUser;
})
.finally(() => loading.value = false);
};