Add makeshift solution to fetch cawangan data

This commit is contained in:
Afiq Hamzah
2023-12-03 12:04:39 +08:00
parent ed823fe411
commit ee17aacaee
+11 -6
View File
@@ -1,7 +1,7 @@
<template>
<div class="mx-auto">
<a v-if="route === 'ada'" class="text-yellow-200 rounded bg-gray-400 px-6 py-3 font-bold mr-4 uppercase sm:invisible lg:visible xl:visible">
CAWANGAN :
CAWANGAN :
<select v-model="caw" @change="tukarcawangan" class="rounded-md border bg-gray-400 font-bold border-gray-400 focus:outline-none rounded-md focus:ring-1 ring-cyan-500 uppercase">
<option v-for="(caw,i) in cawangan" :key="i" :value="caw.kodcaw">{{ caw.details_caw }}</option>
</select>
@@ -33,17 +33,20 @@
},
created() {
this.caw = this.$kodcaw
this.axios.get('/api/check/cawangan').then(response => {
this.cawangan = response.data;
});
fetch('/api/check/cawangan')
.then(response => response.json()).then(response => this.cawangan = response);
},
methods:{
tukarcawangan: function(){
this.setkodcaw(this.caw)
// this.sethostname(this.caw)
this.pembahagiancawangan(this.caw)
@@ -66,8 +69,10 @@
}
return namcaw;
},
pembahagiancawangan: function(cawangannama){
switch (cawangannama) {
@@ -101,7 +106,7 @@
// this.$hostname = 'http://api2.arrahn'
this.sethostname('http://api2.arrahn')
break;
}
}
case '011229':
case '011230':
case '011227':