Skip to content

Commit 82ce3c4

Browse files
committed
fix: update API URL references to use VITE_DEPLOYSTACK_BACKEND_URL in AppSidebar and TeamService components
1 parent 33d6e28 commit 82ce3c4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

services/frontend/src/components/AppSidebar.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { ref, onMounted, defineProps } from 'vue' // Added defineProps
33
import { useRouter } from 'vue-router'
44
import { useI18n } from 'vue-i18n'
5+
import { getEnv } from '@/utils/env' // Import getEnv
56
// import { cn } from '@/lib/utils' // cn might not be needed for root if $attrs.class is used directly
67
// import { ScrollArea } from '@/components/ui/scroll-area' // SidebarContent should handle scrolling
78
@@ -83,9 +84,9 @@ const navigationItems = [
8384
// Fetch user data logic (remains the same)
8485
const fetchUserData = async () => {
8586
try {
86-
const apiUrl = import.meta.env.VITE_DEPLOYSTACK_APP_URL
87+
const apiUrl = getEnv('VITE_DEPLOYSTACK_BACKEND_URL') // Use getEnv with the correct key
8788
if (!apiUrl) {
88-
throw new Error('API URL not configured')
89+
throw new Error('API URL not configured. Make sure VITE_DEPLOYSTACK_BACKEND_URL is set.')
8990
}
9091
const response = await fetch(`${apiUrl}/api/users/me`, { method: 'GET', headers: { 'Content-Type': 'application/json' }, credentials: 'include' })
9192
if (!response.ok) {

services/frontend/src/services/teamService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export interface TeamResponse {
1717

1818
export class TeamService {
1919
private static getApiUrl(): string {
20-
const apiUrl = getEnv('VITE_DEPLOYSTACK_APP_URL')
20+
const apiUrl = getEnv('VITE_DEPLOYSTACK_BACKEND_URL') // Corrected key
2121
if (!apiUrl) {
22-
throw new Error('API URL not configured')
22+
throw new Error('API URL not configured. Make sure VITE_DEPLOYSTACK_BACKEND_URL is set.')
2323
}
2424
return apiUrl
2525
}

0 commit comments

Comments
 (0)