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:
@@ -83,7 +83,7 @@ export interface PlatformUser {
|
||||
* Get all businesses (platform admin only)
|
||||
*/
|
||||
export const getBusinesses = async (): Promise<PlatformBusiness[]> => {
|
||||
const response = await apiClient.get<PlatformBusiness[]>('/api/platform/businesses/');
|
||||
const response = await apiClient.get<PlatformBusiness[]>('/platform/businesses/');
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ export const updateBusiness = async (
|
||||
data: PlatformBusinessUpdate
|
||||
): Promise<PlatformBusiness> => {
|
||||
const response = await apiClient.patch<PlatformBusiness>(
|
||||
`/api/platform/businesses/${businessId}/`,
|
||||
`/platform/businesses/${businessId}/`,
|
||||
data
|
||||
);
|
||||
return response.data;
|
||||
@@ -108,7 +108,7 @@ export const createBusiness = async (
|
||||
data: PlatformBusinessCreate
|
||||
): Promise<PlatformBusiness> => {
|
||||
const response = await apiClient.post<PlatformBusiness>(
|
||||
'/api/platform/businesses/',
|
||||
'/platform/businesses/',
|
||||
data
|
||||
);
|
||||
return response.data;
|
||||
@@ -118,7 +118,7 @@ export const createBusiness = async (
|
||||
* Get all users (platform admin only)
|
||||
*/
|
||||
export const getUsers = async (): Promise<PlatformUser[]> => {
|
||||
const response = await apiClient.get<PlatformUser[]>('/api/platform/users/');
|
||||
const response = await apiClient.get<PlatformUser[]>('/platform/users/');
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -126,7 +126,7 @@ export const getUsers = async (): Promise<PlatformUser[]> => {
|
||||
* Get users for a specific business
|
||||
*/
|
||||
export const getBusinessUsers = async (businessId: number): Promise<PlatformUser[]> => {
|
||||
const response = await apiClient.get<PlatformUser[]>(`/api/platform/users/?business=${businessId}`);
|
||||
const response = await apiClient.get<PlatformUser[]>(`/platform/users/?business=${businessId}`);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -209,7 +209,7 @@ export interface TenantInvitationAccept {
|
||||
* Get all tenant invitations (platform admin only)
|
||||
*/
|
||||
export const getTenantInvitations = async (): Promise<TenantInvitation[]> => {
|
||||
const response = await apiClient.get<TenantInvitation[]>('/api/platform/tenant-invitations/');
|
||||
const response = await apiClient.get<TenantInvitation[]>('/platform/tenant-invitations/');
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -220,7 +220,7 @@ export const createTenantInvitation = async (
|
||||
data: TenantInvitationCreate
|
||||
): Promise<TenantInvitation> => {
|
||||
const response = await apiClient.post<TenantInvitation>(
|
||||
'/api/platform/tenant-invitations/',
|
||||
'/platform/tenant-invitations/',
|
||||
data
|
||||
);
|
||||
return response.data;
|
||||
@@ -230,14 +230,14 @@ export const createTenantInvitation = async (
|
||||
* Resend a tenant invitation (platform admin only)
|
||||
*/
|
||||
export const resendTenantInvitation = async (invitationId: number): Promise<void> => {
|
||||
await apiClient.post(`/api/platform/tenant-invitations/${invitationId}/resend/`);
|
||||
await apiClient.post(`/platform/tenant-invitations/${invitationId}/resend/`);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cancel a tenant invitation (platform admin only)
|
||||
*/
|
||||
export const cancelTenantInvitation = async (invitationId: number): Promise<void> => {
|
||||
await apiClient.post(`/api/platform/tenant-invitations/${invitationId}/cancel/`);
|
||||
await apiClient.post(`/platform/tenant-invitations/${invitationId}/cancel/`);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -245,7 +245,7 @@ export const cancelTenantInvitation = async (invitationId: number): Promise<void
|
||||
*/
|
||||
export const getInvitationByToken = async (token: string): Promise<TenantInvitationDetail> => {
|
||||
const response = await apiClient.get<TenantInvitationDetail>(
|
||||
`/api/platform/tenant-invitations/token/${token}/`
|
||||
`/platform/tenant-invitations/token/${token}/`
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
@@ -258,7 +258,7 @@ export const acceptInvitation = async (
|
||||
data: TenantInvitationAccept
|
||||
): Promise<{ detail: string }> => {
|
||||
const response = await apiClient.post<{ detail: string }>(
|
||||
`/api/platform/tenant-invitations/token/${token}/accept/`,
|
||||
`/platform/tenant-invitations/token/${token}/accept/`,
|
||||
data
|
||||
);
|
||||
return response.data;
|
||||
|
||||
Reference in New Issue
Block a user