File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change
1
+ VITE_TEST_API_URL = https://test-api.eventyay.com/v1
2
+ VITE_PROD_API_URL = https://api.eventyay.com/v1
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ import { mande, defaults } from 'mande'
2
2
import { defineStore } from 'pinia'
3
3
4
4
export const useApiStore = defineStore ( 'api' , ( ) => {
5
- let instance = mande ( 'https://test-api.eventyay.com/v1/' )
5
+ const apiUrl = import . meta. env . PROD ? import . meta. env . VITE_PROD_API_URL : import . meta. env . VITE_TEST_API_URL
6
+ let instance = mande ( apiUrl )
6
7
7
8
function setToken ( ) {
8
9
const token = localStorage . getItem ( 'token' )
@@ -15,7 +16,7 @@ export const useApiStore = defineStore('api', () => {
15
16
16
17
function newSession ( authenticated ) {
17
18
// reinit
18
- instance = mande ( 'https://test-api.eventyay.com/v1/' )
19
+ instance = mande ( apiUrl )
19
20
if ( authenticated ) {
20
21
setToken ( )
21
22
} else {
You can’t perform that action at this time.
0 commit comments