refactor(frontend): Remove '/api' prefix from all API calls to align with backend URL convention

- Updated all API endpoint strings in 'frontend/src' (via sed and manual fixes) to remove the '/api/' prefix.
- Manually fixed 'Timeline.tsx' absolute URLs to use the 'api' subdomain and correct path.
- Manually fixed 'useAuth.ts' logout fetch URLs.
- Updated 'HelpApiDocs.tsx' sandbox URL.
- This change, combined with the backend URL update, fully transitions the application to use subdomain-based routing (e.g., 'http://api.lvh.me:8000/resource/') instead of path-prefix routing (e.g., 'http://api.lvh.me:8000/api/resource/').
This commit is contained in:
poduck
2025-12-01 02:14:17 -05:00
parent 92724d03b6
commit b3e2c1f324
19 changed files with 92 additions and 82 deletions

View File

@@ -89,7 +89,7 @@ export function DevQuickLogin({ embedded = false }: DevQuickLoginProps) {
setLoading(user.username);
try {
// Call token auth API
const response = await apiClient.post('/api/auth-token/', {
const response = await apiClient.post('/auth-token/', {
username: user.username,
password: user.password,
});
@@ -98,7 +98,7 @@ export function DevQuickLogin({ embedded = false }: DevQuickLoginProps) {
setCookie('access_token', response.data.token, 7);
// Fetch user data to determine redirect
const userResponse = await apiClient.get('/api/auth/me/');
const userResponse = await apiClient.get('/auth/me/');
const userData = userResponse.data;
// Determine the correct subdomain based on user role