32 lines
971 B
TypeScript
Executable File
32 lines
971 B
TypeScript
Executable File
import axios from 'axios'
|
|
|
|
const url = import.meta.env.VITE_APP_REST_ENDPOINT
|
|
const instance = axios.create({
|
|
baseURL: url
|
|
})
|
|
|
|
const ax = axios.create({
|
|
baseURL: window.location.origin
|
|
})
|
|
|
|
const getUid = async () => await instance.get('/uid')
|
|
const getUidRegional = async (regional: number) => await instance.get('/uid?regional=' + regional)
|
|
const getRegional = async () => await instance.get('/regional')
|
|
const getMedia = async () => await instance.get('/media')
|
|
const getJenisTransaksi = async () => await instance.get('/jenisTransaksi')
|
|
const getUp3 = async (uid: number) => await instance.get('/up3?uid=' + uid)
|
|
const getUlp = async (up3: number) => await instance.get('/ulp?up3=' + up3)
|
|
const getPosko = async (uppp: number) => await instance.get('/posko?up3=' + uppp)
|
|
const getVersion = async () => await ax.get('/version.json')
|
|
export {
|
|
getUid,
|
|
getUp3,
|
|
getPosko,
|
|
getUlp,
|
|
getMedia,
|
|
getJenisTransaksi,
|
|
getUidRegional,
|
|
getRegional,
|
|
getVersion
|
|
}
|