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

@@ -95,7 +95,7 @@ const PluginMarketplace: React.FC = () => {
const { data: plugins = [], isLoading, error } = useQuery<PluginTemplate[]>({
queryKey: ['plugin-templates', 'marketplace'],
queryFn: async () => {
const { data } = await api.get('/api/plugin-templates/?view=marketplace');
const { data } = await api.get('/plugin-templates/?view=marketplace');
return data.map((p: any) => ({
id: String(p.id),
name: p.name,
@@ -120,7 +120,7 @@ const PluginMarketplace: React.FC = () => {
const { data: installedPlugins = [] } = useQuery<{ template: number }[]>({
queryKey: ['plugin-installations'],
queryFn: async () => {
const { data } = await api.get('/api/plugin-installations/');
const { data } = await api.get('/plugin-installations/');
return data;
},
});
@@ -133,7 +133,7 @@ const PluginMarketplace: React.FC = () => {
// Install plugin mutation
const installMutation = useMutation({
mutationFn: async (templateId: string) => {
const { data } = await api.post('/api/plugin-installations/', {
const { data } = await api.post('/plugin-installations/', {
template: templateId,
});
return data;
@@ -187,7 +187,7 @@ const PluginMarketplace: React.FC = () => {
// Fetch full plugin details including plugin_code
setIsLoadingDetails(true);
try {
const { data } = await api.get(`/api/plugin-templates/${plugin.id}/`);
const { data } = await api.get(`/plugin-templates/${plugin.id}/`);
setSelectedPlugin({
...plugin,
pluginCode: data.plugin_code,