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:
poduck
2025-11-30 16:04:20 -05:00
parent 4cd6610f2a
commit 2b28fc49c9
6 changed files with 40 additions and 40 deletions

View File

@@ -45,7 +45,7 @@ export interface OAuthConnection {
* Get list of enabled OAuth providers
*/
export const getOAuthProviders = async (): Promise<OAuthProvider[]> => {
const response = await apiClient.get<{ providers: OAuthProvider[] }>('/api/auth/oauth/providers/');
const response = await apiClient.get<{ providers: OAuthProvider[] }>('/auth/oauth/providers/');
return response.data.providers;
};
@@ -54,7 +54,7 @@ export const getOAuthProviders = async (): Promise<OAuthProvider[]> => {
*/
export const initiateOAuth = async (provider: string): Promise<OAuthAuthorizationResponse> => {
const response = await apiClient.get<OAuthAuthorizationResponse>(
`/api/auth/oauth/${provider}/authorize/`
`/auth/oauth/${provider}/authorize/`
);
return response.data;
};
@@ -68,7 +68,7 @@ export const handleOAuthCallback = async (
state: string
): Promise<OAuthTokenResponse> => {
const response = await apiClient.post<OAuthTokenResponse>(
`/api/auth/oauth/${provider}/callback/`,
`/auth/oauth/${provider}/callback/`,
{
code,
state,
@@ -81,7 +81,7 @@ export const handleOAuthCallback = async (
* Get user's connected OAuth accounts
*/
export const getOAuthConnections = async (): Promise<OAuthConnection[]> => {
const response = await apiClient.get<{ connections: OAuthConnection[] }>('/api/auth/oauth/connections/');
const response = await apiClient.get<{ connections: OAuthConnection[] }>('/auth/oauth/connections/');
return response.data.connections;
};
@@ -89,5 +89,5 @@ export const getOAuthConnections = async (): Promise<OAuthConnection[]> => {
* Disconnect an OAuth account
*/
export const disconnectOAuth = async (provider: string): Promise<void> => {
await apiClient.delete(`/api/auth/oauth/connections/${provider}/`);
await apiClient.delete(`/auth/oauth/connections/${provider}/`);
};