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 { CustomDomain } from '../types';
|
||||
* Get all custom domains for the current business
|
||||
*/
|
||||
export const getCustomDomains = async (): Promise<CustomDomain[]> => {
|
||||
const response = await apiClient.get<CustomDomain[]>('/api/business/domains/');
|
||||
const response = await apiClient.get<CustomDomain[]>('/business/domains/');
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getCustomDomains = async (): Promise<CustomDomain[]> => {
|
||||
* Add a new custom domain
|
||||
*/
|
||||
export const addCustomDomain = async (domain: string): Promise<CustomDomain> => {
|
||||
const response = await apiClient.post<CustomDomain>('/api/business/domains/', {
|
||||
const response = await apiClient.post<CustomDomain>('/business/domains/', {
|
||||
domain: domain.toLowerCase().trim(),
|
||||
});
|
||||
return response.data;
|
||||
@@ -27,7 +27,7 @@ export const addCustomDomain = async (domain: string): Promise<CustomDomain> =>
|
||||
* Delete a custom domain
|
||||
*/
|
||||
export const deleteCustomDomain = async (domainId: number): Promise<void> => {
|
||||
await apiClient.delete(`/api/business/domains/${domainId}/`);
|
||||
await apiClient.delete(`/business/domains/${domainId}/`);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ export const deleteCustomDomain = async (domainId: number): Promise<void> => {
|
||||
*/
|
||||
export const verifyCustomDomain = async (domainId: number): Promise<{ verified: boolean; message: string }> => {
|
||||
const response = await apiClient.post<{ verified: boolean; message: string }>(
|
||||
`/api/business/domains/${domainId}/verify/`
|
||||
`/business/domains/${domainId}/verify/`
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
@@ -45,7 +45,7 @@ export const verifyCustomDomain = async (domainId: number): Promise<{ verified:
|
||||
*/
|
||||
export const setPrimaryDomain = async (domainId: number): Promise<CustomDomain> => {
|
||||
const response = await apiClient.post<CustomDomain>(
|
||||
`/api/business/domains/${domainId}/set-primary/`
|
||||
`/business/domains/${domainId}/set-primary/`
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user