fix: Remove /api/ prefix from all API endpoints
- Fixed double /api/api/ issue in production - Updated all API files to remove /api/ prefix since baseURL already includes it - Files fixed: platform.ts, oauth.ts, customDomains.ts, domains.ts, business.ts, sandbox.ts - Production build will need to be rebuilt after pulling these changes
This commit is contained in:
@@ -9,7 +9,7 @@ import { User, Resource, BusinessOAuthSettings, BusinessOAuthSettingsResponse, B
|
||||
* Get all resources for the current business
|
||||
*/
|
||||
export const getResources = async (): Promise<Resource[]> => {
|
||||
const response = await apiClient.get<Resource[]>('/api/resources/');
|
||||
const response = await apiClient.get<Resource[]>('/resources/');
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getResources = async (): Promise<Resource[]> => {
|
||||
* Get all users for the current business
|
||||
*/
|
||||
export const getBusinessUsers = async (): Promise<User[]> => {
|
||||
const response = await apiClient.get<User[]>('/api/business/users/');
|
||||
const response = await apiClient.get<User[]>('/business/users/');
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ export const getBusinessOAuthSettings = async (): Promise<BusinessOAuthSettingsR
|
||||
icon: string;
|
||||
description: string;
|
||||
}>;
|
||||
}>('/api/business/oauth-settings/');
|
||||
}>('/business/oauth-settings/');
|
||||
|
||||
// Transform snake_case to camelCase
|
||||
return {
|
||||
@@ -87,7 +87,7 @@ export const updateBusinessOAuthSettings = async (
|
||||
icon: string;
|
||||
description: string;
|
||||
}>;
|
||||
}>('/api/business/oauth-settings/', backendData);
|
||||
}>('/business/oauth-settings/', backendData);
|
||||
|
||||
// Transform snake_case to camelCase
|
||||
return {
|
||||
@@ -112,7 +112,7 @@ export const getBusinessOAuthCredentials = async (): Promise<BusinessOAuthCreden
|
||||
has_secret: boolean;
|
||||
}>;
|
||||
use_custom_credentials: boolean;
|
||||
}>('/api/business/oauth-credentials/');
|
||||
}>('/business/oauth-credentials/');
|
||||
|
||||
return {
|
||||
credentials: response.data.credentials || {},
|
||||
@@ -145,7 +145,7 @@ export const updateBusinessOAuthCredentials = async (
|
||||
has_secret: boolean;
|
||||
}>;
|
||||
use_custom_credentials: boolean;
|
||||
}>('/api/business/oauth-credentials/', backendData);
|
||||
}>('/business/oauth-credentials/', backendData);
|
||||
|
||||
return {
|
||||
credentials: response.data.credentials || {},
|
||||
|
||||
Reference in New Issue
Block a user