Merge branch 'dev-bagus' of https://github.com/defuj/eis into dev-defuj

This commit is contained in:
Dede Fuji Abdul
2024-02-27 16:26:36 +07:00
20 changed files with 1505 additions and 864 deletions

View File

@ -1,12 +1,10 @@
import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client/core'
export const apolloClient = () => {
const httpLink = createHttpLink({
uri: import.meta.env.VITE_APP_GRAPHQL_ENDPOINT,
credentials: 'include',
});
credentials: 'include' // Include credentials for cross-origin requests
})
const apolloClient = new ApolloClient({
cache: new InMemoryCache(),
@ -16,9 +14,9 @@ export const apolloClient = () => {
'Accept-Encoding': 'gzip, deflate',
'Cache-Control': 'no-cache',
Connection: 'keep-alive',
'Content-Type': 'application/json',
'Content-Type': 'application/json'
// Add other headers as needed
},
});
return apolloClient;
}
}
})
return apolloClient
}

View File

@ -1,5 +1,6 @@
import axios from 'axios'
const url = import.meta.env.VITE_APP_REST_ENDPOINT as string
const url = import.meta.env.VITE_APP_REST_ENDPOINT
const instance = axios.create({
baseURL: url
})
@ -12,4 +13,13 @@ 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)
export { getUid, getUp3, getPosko, getUlp, getMedia, getJenisTransaksi, getUidRegional, getRegional }
export {
getUid,
getUp3,
getPosko,
getUlp,
getMedia,
getJenisTransaksi,
getUidRegional,
getRegional
}