From deb9523aa7fe32b0478198d41bdd28ab8fc21cfc Mon Sep 17 00:00:00 2001 From: marcoc Date: Wed, 12 Mar 2025 10:14:16 +0100 Subject: [PATCH] feat(fe track type): added track type composable --- .../js/composables/content/track_type.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 resources/js/composables/content/track_type.ts diff --git a/resources/js/composables/content/track_type.ts b/resources/js/composables/content/track_type.ts new file mode 100644 index 0000000..8018e40 --- /dev/null +++ b/resources/js/composables/content/track_type.ts @@ -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} +} \ No newline at end of file