Fixes here and there
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const apiURL: string = process.env.NODE_ENV === 'development'
|
||||
// Define API URL from environment
|
||||
export const API_URL = import.meta.env.MODE === 'development'
|
||||
? `${import.meta.env.VITE_API_URL_DEV}`
|
||||
: `${import.meta.env.VITE_API_URL_PROD}`
|
||||
|
||||
@@ -8,7 +9,7 @@ const apiURL: string = process.env.NODE_ENV === 'development'
|
||||
*/
|
||||
export const fetchAPI = async (query: string) => {
|
||||
try {
|
||||
const res = await fetch(`${apiURL}${import.meta.env.VITE_API_GRAPHQL_PATH}`, {
|
||||
const res = await fetch(`${API_URL}${import.meta.env.VITE_API_GRAPHQL_PATH}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user