feat(fe track type): added track type composable
This commit is contained in:
parent
126d0553b0
commit
deb9523aa7
1 changed files with 21 additions and 0 deletions
21
resources/js/composables/content/track_type.ts
Normal file
21
resources/js/composables/content/track_type.ts
Normal 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}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue