File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,10 +45,10 @@ export default function WelcomeSettings({ guildId }: { guildId: string }) {
4545 const fetchData = async ( ) => {
4646 if ( ! token || ! guildId ) return ;
4747 try {
48- const base = " http://localhost:8040/dashboard/settings" ;
48+ const baseUrl = import . meta . env . VITE_API_URL || ' http://localhost:8040' ;
4949
5050 // Fetch Channels
51- const channelRes = await fetch ( `http://localhost:8040/v1/managerx /dashboard/guilds/${ guildId } /channels` , {
51+ const channelRes = await fetch ( `${ baseUrl } /dashboard/guilds/${ guildId } /channels` , {
5252 headers : { "Authorization" : `Bearer ${ token } ` }
5353 } ) ;
5454 if ( channelRes . ok ) {
@@ -57,7 +57,7 @@ export default function WelcomeSettings({ guildId }: { guildId: string }) {
5757 }
5858
5959 // Fetch Welcome Settings
60- const settingsRes = await fetch ( `${ base } /${ guildId } /welcome` , {
60+ const settingsRes = await fetch ( `${ baseUrl } /dashboard/settings /${ guildId } /welcome` , {
6161 headers : { "Authorization" : `Bearer ${ token } ` }
6262 } ) ;
6363 if ( settingsRes . ok ) {
@@ -97,7 +97,8 @@ export default function WelcomeSettings({ guildId }: { guildId: string }) {
9797 ping_user : pingUser
9898 } ;
9999
100- const res = await fetch ( `http://localhost:8040/dashboard/settings/${ guildId } /welcome` , {
100+ const baseUrl = import . meta. env . VITE_API_URL || 'http://localhost:8040' ;
101+ const res = await fetch ( `${ baseUrl } /dashboard/settings/${ guildId } /welcome` , {
101102 method : "POST" ,
102103 headers : {
103104 "Authorization" : `Bearer ${ token } ` ,
You can’t perform that action at this time.
0 commit comments