Homepage, verejna cast, vetsi sada uprav a oprav
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user