Update posko parameter to accept integer instead of string
This commit is contained in:
@ -20,7 +20,7 @@ const mediaPlaceholder = 'Semua Media'
|
||||
const up3 = ref({ id: 0, name: up3Placeholder })
|
||||
const uid = ref({ id: 0, name: uidPlaceholder })
|
||||
const posko = ref({ id: 0, name: poskoPlaceholder })
|
||||
const media = ref({ id: 0, name: mediaPlaceholder })
|
||||
const media = ref({ id: "", name: mediaPlaceholder })
|
||||
const emit = defineEmits(['update:filters'])
|
||||
const data = ref({
|
||||
uid: uid.value,
|
||||
|
@ -2,7 +2,7 @@ import { usePostsStore } from '@/stores/posts'
|
||||
import { useRegionStore } from '@/stores/region'
|
||||
import { useUlpStore } from '@/stores/ulp'
|
||||
import { useUp3Store } from '@/stores/up3'
|
||||
import { getUid, getUp3, getPosko, getUlp,getRegional } from '@/utils/network'
|
||||
import { getUid, getUp3, getPosko, getUlp, getRegional } from '@/utils/network'
|
||||
import { ref } from 'vue'
|
||||
interface Item {
|
||||
id: any
|
||||
@ -55,8 +55,8 @@ const fetchMedia = () => {
|
||||
// Fetch data from the API using Axios
|
||||
const fetchUid = async () => {
|
||||
try {
|
||||
const res = await getRegional()
|
||||
itemsRegional.value = res.data.map((item: any) => (
|
||||
const res = await getUid()
|
||||
itemsUid.value = res.data.map((item: any) => (
|
||||
{
|
||||
id: item.id,
|
||||
name: item.nama.toUpperCase(),
|
||||
@ -100,31 +100,20 @@ const fetchDataPosko = async (up3: number) => {
|
||||
console.error('Error fetching data:', error)
|
||||
}
|
||||
}
|
||||
const fetchRegional = () => {
|
||||
itemsRegional.value = [
|
||||
{ id: '1', name: 'Wilayah Sumatera' },
|
||||
{ id: '2', name: 'Wilayah Jawa Bali' },
|
||||
{ id: '3', name: 'Wilayah Kalimantan' },
|
||||
{ id: '4', name: 'Wilayah Sulawesi' },
|
||||
{ id: '5', name: 'Wilayah Nusa Tenggara' },
|
||||
{ id: '6', name: 'Wilayah Maluku Papua' }
|
||||
]
|
||||
}
|
||||
const fetchStatus = (data: any) => {
|
||||
const status = [
|
||||
{ id: '8', name: 'Selesai' },
|
||||
{ id: '7', name: 'Nyala' },
|
||||
{ id: '6', name: 'Pengalihan' },
|
||||
{ id: '5', name: 'Dialihkan' },
|
||||
{ id: '4', name: 'Dalam Pengerjaan' },
|
||||
{ id: '3', name: 'Dalam Perjalanan' },
|
||||
{ id: '2', name: 'Penugasan Regu' },
|
||||
{ id: '1', name: 'lapor' }
|
||||
]
|
||||
const filteredStatus = status.find((item) => item.id == data)
|
||||
const name = filteredStatus ? filteredStatus.name : null
|
||||
return name
|
||||
const fetchRegional = async () => {
|
||||
try {
|
||||
const res = await getRegional()
|
||||
itemsRegional.value = res.data.map((item: any) => (
|
||||
{
|
||||
id: item.id,
|
||||
name: item.nama.toUpperCase(),
|
||||
}
|
||||
));
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
}
|
||||
}
|
||||
|
||||
const selectedUid = (value: any) => {
|
||||
useRegionStore().setData(value.id)
|
||||
fetchDataUp3(value.id)
|
||||
|
Reference in New Issue
Block a user