feat(fe track type): added track type composable

This commit is contained in:
Marco Cavalli 2025-03-12 10:14:16 +01:00
parent 126d0553b0
commit deb9523aa7

View file

@ -0,0 +1,21 @@
import { ref, reactive } from 'vue'
import axios from "axios";
export function trackType(parents) {
const trackTypes = ref([]);
const getTrackTypes = async () => {
axios.get('/track_type', {
params: {
parents: parents
}
}).then(async (response) => {
trackTypes.value = response.data;
}).catch((error) => {
console.log("Error: ", error);
})
}
getTrackTypes();
return {trackTypes}
}