composables, mazani letu, skeletony
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import {ref} from "vue";
|
||||
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
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)
|
||||
.finally(() => loading.value = false);
|
||||
};
|
||||
|
||||
|
||||
export const pointsOfInterest = storeToRefs(usePointsOfInterestStore()).items;
|
||||
export const fetchPOIList = () => {
|
||||
loading.value = true;
|
||||
usePointsOfInterestStore().fetch().finally(() => loading.value = false);
|
||||
}
|
||||
Reference in New Issue
Block a user