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

@@ -123,7 +123,7 @@ const CreateTaskModal: React.FC<CreateTaskModalProps> = ({ isOpen, onClose, onSu
const { data: plugins = [], isLoading: pluginsLoading } = useQuery<PluginInstallation[]>({
queryKey: ['plugin-installations'],
queryFn: async () => {
const { data } = await axios.get('/api/plugin-installations/');
const { data } = await axios.get('/plugin-installations/');
// Filter out plugins that already have scheduled tasks
return data.filter((p: PluginInstallation) => !p.scheduled_task);
},
@@ -209,7 +209,7 @@ const CreateTaskModal: React.FC<CreateTaskModalProps> = ({ isOpen, onClose, onSu
apply_to_existing: applyToExisting,
};
await axios.post('/api/global-event-plugins/', payload);
await axios.post('/global-event-plugins/', payload);
queryClient.invalidateQueries({ queryKey: ['global-event-plugins'] });
toast.success(applyToExisting ? 'Plugin attached to all events' : 'Plugin will apply to future events');
} else {
@@ -240,7 +240,7 @@ const CreateTaskModal: React.FC<CreateTaskModalProps> = ({ isOpen, onClose, onSu
}
}
await axios.post('/api/scheduled-tasks/', payload);
await axios.post('/scheduled-tasks/', payload);
toast.success('Scheduled task created');
}