Prace s mapou, refresh tokenu (tak nejak), uprava vypisu POI, pridani breadcrumbs

This commit is contained in:
Michal Kváček
2023-07-29 23:26:51 +02:00
parent 864db6c6a2
commit 09d2f25523
42 changed files with 597 additions and 241 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { date } from "quasar";
import {date} from "quasar";
export const FORMAT_ISO = "YYYY-MM-DDTHH:mm:ss";
export const FORMAT_DATETIME_LONG = "DD. MM. YYYY, HH:mm";
+6
View File
@@ -10,3 +10,9 @@ export const successObject = (message) => ({
position: "top",
color: "positive"
});
export const errorObject = (message) => ({
message,
position: "top",
color: "negative"
})
-10
View File
@@ -1,10 +0,0 @@
import {useMeta} from "quasar";
export const setTitle = (title) => {
// todo: otestovat, nevim proc je tam ta factory
const metadata = {
titleTemplate: () => `${title} - Polétání.cz`,
}
useMeta(metadata);
}
+6 -3
View File
@@ -6,13 +6,16 @@ export const loading = ref(true);
export const copilot = ref(null);
export const fetchCopilot = (copilotId) => {
loading.value = true;
useCopilotsStore().fetchDetail(parseInt(copilotId))
.then(resp => copilot.value = resp)
return useCopilotsStore().fetchDetail(parseInt(copilotId))
.then(resp => {
copilot.value = resp;
return resp;
})
.finally(() => loading.value = false);
}
export const copilots = storeToRefs(useCopilotsStore()).items;
export const fetchCopilots = () => {
loading.value = true;
useCopilotsStore().fetch().finally(() => loading.value = false);
return useCopilotsStore().fetch().finally(() => loading.value = false);
}
+6 -3
View File
@@ -6,8 +6,11 @@ export const loading = ref(true);
export const poi = ref(null);
export const fetchPoi = (poiId) => {
loading.value = true;
usePointsOfInterestStore().fetchDetail(poiId)
.then(data => poi.value = data)
return usePointsOfInterestStore().fetchDetail(poiId)
.then(data => {
poi.value = data;
return data;
})
.finally(() => loading.value = false);
};
@@ -15,5 +18,5 @@ export const fetchPoi = (poiId) => {
export const pointsOfInterest = storeToRefs(usePointsOfInterestStore()).items;
export const fetchPOIList = () => {
loading.value = true;
usePointsOfInterestStore().fetch().finally(() => loading.value = false);
return usePointsOfInterestStore().fetch().finally(() => loading.value = false);
}
+1 -1
View File
@@ -1,3 +1,3 @@
export const randomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
return Math.floor(Math.random() * (max - min + 1)) + min;
}