Commit bc128b98 authored by d.arizona's avatar d.arizona

tambahan

parent 4fddb389
// a library to wrap and simplify api calls
import apisauce from 'apisauce'
import Constant from '../library/Constant'
// our "constructor"
const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/') => {
......@@ -25,13 +26,13 @@ const create = (baseURL = 'https://trftia.eksad.com/tia-reporting-dev/public/')
api.addAsyncRequestTransform(request => async () => {
var token
try {
// const res = await AsyncStorage.getItem("TOKEN")
const res = await localStorage.getItem(Constant.TOKEN)
if (token != null) {
token = token
token = res
// alert(url)
// api.setBaseURL(`${url}/api/`)
} else {
token = null
token = res
// url = Constant.BASE_URL.MASTER + '/api/'
// alert(url)
// api.setBaseURL(`${url}/api/`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment