@@ -16,6 +16,7 @@ import { defineStore } from 'pinia'
1616import { computed , ref } from 'vue'
1717import { useFirebaseAuth } from 'vuefire'
1818
19+ import { COMFY_API_BASE_URL } from '@/config/comfyApi'
1920import { t } from '@/i18n'
2021import { useDialogService } from '@/services/dialogService'
2122import { operations } from '@/types/comfyRegistryTypes'
@@ -35,9 +36,6 @@ type AccessBillingPortalResponse =
3536type AccessBillingPortalReqBody =
3637 operations [ 'AccessBillingPortal' ] [ 'requestBody' ]
3738
38- // TODO: Switch to prod api based on environment (requires prod api to be ready)
39- const API_BASE_URL = 'https://stagingapi.comfy.org'
40-
4139export const useFirebaseAuthStore = defineStore ( 'firebaseAuth' , ( ) => {
4240 // State
4341 const loading = ref ( false )
@@ -105,7 +103,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
105103 return null
106104 }
107105
108- const response = await fetch ( `${ API_BASE_URL } /customers/balance` , {
106+ const response = await fetch ( `${ COMFY_API_BASE_URL } /customers/balance` , {
109107 headers : {
110108 Authorization : `Bearer ${ token } `
111109 }
@@ -137,7 +135,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
137135 const createCustomer = async (
138136 token : string
139137 ) : Promise < CreateCustomerResponse > => {
140- const createCustomerRes = await fetch ( `${ API_BASE_URL } /customers` , {
138+ const createCustomerRes = await fetch ( `${ COMFY_API_BASE_URL } /customers` , {
141139 method : 'POST' ,
142140 headers : {
143141 'Content-Type' : 'application/json' ,
@@ -243,7 +241,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
243241 customerCreated . value = true
244242 }
245243
246- const response = await fetch ( `${ API_BASE_URL } /customers/credit` , {
244+ const response = await fetch ( `${ COMFY_API_BASE_URL } /customers/credit` , {
247245 method : 'POST' ,
248246 headers : {
249247 'Content-Type' : 'application/json' ,
@@ -284,7 +282,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
284282 return null
285283 }
286284
287- const response = await fetch ( `${ API_BASE_URL } /customers/billing` , {
285+ const response = await fetch ( `${ COMFY_API_BASE_URL } /customers/billing` , {
288286 method : 'POST' ,
289287 headers : {
290288 'Content-Type' : 'application/json' ,
0 commit comments