Commit 10e3007d authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

tambahan

See merge request !37
parents c169b52d bc128b98
// 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