Skip to content

Commit 85e1185

Browse files
Merge pull request #200 from ManagerX-Development/dev-builds/2.0.0-dashboard
feat: implement WelcomeSettings UI component and add backend utility …
2 parents 6ed7a5f + dde5bbf commit 85e1185

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/web/components/WelcomeSettings.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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}`,

0 commit comments

Comments
 (0)