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
|
* Get all resources for the current business
|
||||||
*/
|
*/
|
||||||
export const getResources = async (): Promise<Resource[]> => {
|
export const getResources = async (): Promise<Resource[]> => {
|
||||||
const response = await apiClient.get<Resource[]>('/api/resources/');
|
const response = await apiClient.get<Resource[]>('/resources/');
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ export const getResources = async (): Promise<Resource[]> => {
|
|||||||
* Get all users for the current business
|
* Get all users for the current business
|
||||||
*/
|
*/
|
||||||
export const getBusinessUsers = async (): Promise<User[]> => {
|
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;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ export const getBusinessOAuthSettings = async (): Promise<BusinessOAuthSettingsR
|
|||||||
icon: string;
|
icon: string;
|
||||||
description: string;
|
description: string;
|
||||||
}>;
|
}>;
|
||||||
}>('/api/business/oauth-settings/');
|
}>('/business/oauth-settings/');
|
||||||
|
|
||||||
// Transform snake_case to camelCase
|
// Transform snake_case to camelCase
|
||||||
return {
|
return {
|
||||||
@@ -87,7 +87,7 @@ export const updateBusinessOAuthSettings = async (
|
|||||||
icon: string;
|
icon: string;
|
||||||
description: string;
|
description: string;
|
||||||
}>;
|
}>;
|
||||||
}>('/api/business/oauth-settings/', backendData);
|
}>('/business/oauth-settings/', backendData);
|
||||||
|
|
||||||
// Transform snake_case to camelCase
|
// Transform snake_case to camelCase
|
||||||
return {
|
return {
|
||||||
@@ -112,7 +112,7 @@ export const getBusinessOAuthCredentials = async (): Promise<BusinessOAuthCreden
|
|||||||
has_secret: boolean;
|
has_secret: boolean;
|
||||||
}>;
|
}>;
|
||||||
use_custom_credentials: boolean;
|
use_custom_credentials: boolean;
|
||||||
}>('/api/business/oauth-credentials/');
|
}>('/business/oauth-credentials/');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
credentials: response.data.credentials || {},
|
credentials: response.data.credentials || {},
|
||||||
@@ -145,7 +145,7 @@ export const updateBusinessOAuthCredentials = async (
|
|||||||
has_secret: boolean;
|
has_secret: boolean;
|
||||||
}>;
|
}>;
|
||||||
use_custom_credentials: boolean;
|
use_custom_credentials: boolean;
|
||||||
}>('/api/business/oauth-credentials/', backendData);
|
}>('/business/oauth-credentials/', backendData);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
credentials: response.data.credentials || {},
|
credentials: response.data.credentials || {},
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { CustomDomain } from '../types';
|
|||||||
* Get all custom domains for the current business
|
* Get all custom domains for the current business
|
||||||
*/
|
*/
|
||||||
export const getCustomDomains = async (): Promise<CustomDomain[]> => {
|
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;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ export const getCustomDomains = async (): Promise<CustomDomain[]> => {
|
|||||||
* Add a new custom domain
|
* Add a new custom domain
|
||||||
*/
|
*/
|
||||||
export const addCustomDomain = async (domain: string): Promise<CustomDomain> => {
|
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(),
|
domain: domain.toLowerCase().trim(),
|
||||||
});
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -27,7 +27,7 @@ export const addCustomDomain = async (domain: string): Promise<CustomDomain> =>
|
|||||||
* Delete a custom domain
|
* Delete a custom domain
|
||||||
*/
|
*/
|
||||||
export const deleteCustomDomain = async (domainId: number): Promise<void> => {
|
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 }> => {
|
export const verifyCustomDomain = async (domainId: number): Promise<{ verified: boolean; message: string }> => {
|
||||||
const response = await apiClient.post<{ 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;
|
return response.data;
|
||||||
};
|
};
|
||||||
@@ -45,7 +45,7 @@ export const verifyCustomDomain = async (domainId: number): Promise<{ verified:
|
|||||||
*/
|
*/
|
||||||
export const setPrimaryDomain = async (domainId: number): Promise<CustomDomain> => {
|
export const setPrimaryDomain = async (domainId: number): Promise<CustomDomain> => {
|
||||||
const response = await apiClient.post<CustomDomain>(
|
const response = await apiClient.post<CustomDomain>(
|
||||||
`/api/business/domains/${domainId}/set-primary/`
|
`/business/domains/${domainId}/set-primary/`
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export const searchDomains = async (
|
|||||||
query: string,
|
query: string,
|
||||||
tlds: string[] = ['.com', '.net', '.org']
|
tlds: string[] = ['.com', '.net', '.org']
|
||||||
): Promise<DomainAvailability[]> => {
|
): Promise<DomainAvailability[]> => {
|
||||||
const response = await apiClient.post<DomainAvailability[]>('/api/domains/search/search/', {
|
const response = await apiClient.post<DomainAvailability[]>('/domains/search/search/', {
|
||||||
query,
|
query,
|
||||||
tlds,
|
tlds,
|
||||||
});
|
});
|
||||||
@@ -90,7 +90,7 @@ export const searchDomains = async (
|
|||||||
* Get TLD pricing
|
* Get TLD pricing
|
||||||
*/
|
*/
|
||||||
export const getDomainPrices = async (): Promise<DomainPrice[]> => {
|
export const getDomainPrices = async (): Promise<DomainPrice[]> => {
|
||||||
const response = await apiClient.get<DomainPrice[]>('/api/domains/search/prices/');
|
const response = await apiClient.get<DomainPrice[]>('/domains/search/prices/');
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ export const getDomainPrices = async (): Promise<DomainPrice[]> => {
|
|||||||
export const registerDomain = async (
|
export const registerDomain = async (
|
||||||
data: DomainRegisterRequest
|
data: DomainRegisterRequest
|
||||||
): Promise<DomainRegistration> => {
|
): Promise<DomainRegistration> => {
|
||||||
const response = await apiClient.post<DomainRegistration>('/api/domains/search/register/', data);
|
const response = await apiClient.post<DomainRegistration>('/domains/search/register/', data);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ export const registerDomain = async (
|
|||||||
* Get all registered domains for current business
|
* Get all registered domains for current business
|
||||||
*/
|
*/
|
||||||
export const getRegisteredDomains = async (): Promise<DomainRegistration[]> => {
|
export const getRegisteredDomains = async (): Promise<DomainRegistration[]> => {
|
||||||
const response = await apiClient.get<DomainRegistration[]>('/api/domains/registrations/');
|
const response = await apiClient.get<DomainRegistration[]>('/domains/registrations/');
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ export const getRegisteredDomains = async (): Promise<DomainRegistration[]> => {
|
|||||||
* Get a single domain registration
|
* Get a single domain registration
|
||||||
*/
|
*/
|
||||||
export const getDomainRegistration = async (id: number): Promise<DomainRegistration> => {
|
export const getDomainRegistration = async (id: number): Promise<DomainRegistration> => {
|
||||||
const response = await apiClient.get<DomainRegistration>(`/api/domains/registrations/${id}/`);
|
const response = await apiClient.get<DomainRegistration>(`/domains/registrations/${id}/`);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ export const updateNameservers = async (
|
|||||||
nameservers: string[]
|
nameservers: string[]
|
||||||
): Promise<DomainRegistration> => {
|
): Promise<DomainRegistration> => {
|
||||||
const response = await apiClient.post<DomainRegistration>(
|
const response = await apiClient.post<DomainRegistration>(
|
||||||
`/api/domains/registrations/${id}/update_nameservers/`,
|
`/domains/registrations/${id}/update_nameservers/`,
|
||||||
{ nameservers }
|
{ nameservers }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -142,7 +142,7 @@ export const toggleAutoRenew = async (
|
|||||||
autoRenew: boolean
|
autoRenew: boolean
|
||||||
): Promise<DomainRegistration> => {
|
): Promise<DomainRegistration> => {
|
||||||
const response = await apiClient.post<DomainRegistration>(
|
const response = await apiClient.post<DomainRegistration>(
|
||||||
`/api/domains/registrations/${id}/toggle_auto_renew/`,
|
`/domains/registrations/${id}/toggle_auto_renew/`,
|
||||||
{ auto_renew: autoRenew }
|
{ auto_renew: autoRenew }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -156,7 +156,7 @@ export const renewDomain = async (
|
|||||||
years: number = 1
|
years: number = 1
|
||||||
): Promise<DomainRegistration> => {
|
): Promise<DomainRegistration> => {
|
||||||
const response = await apiClient.post<DomainRegistration>(
|
const response = await apiClient.post<DomainRegistration>(
|
||||||
`/api/domains/registrations/${id}/renew/`,
|
`/domains/registrations/${id}/renew/`,
|
||||||
{ years }
|
{ years }
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -167,7 +167,7 @@ export const renewDomain = async (
|
|||||||
*/
|
*/
|
||||||
export const syncDomain = async (id: number): Promise<DomainRegistration> => {
|
export const syncDomain = async (id: number): Promise<DomainRegistration> => {
|
||||||
const response = await apiClient.post<DomainRegistration>(
|
const response = await apiClient.post<DomainRegistration>(
|
||||||
`/api/domains/registrations/${id}/sync/`
|
`/domains/registrations/${id}/sync/`
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
@@ -176,6 +176,6 @@ export const syncDomain = async (id: number): Promise<DomainRegistration> => {
|
|||||||
* Get domain search history
|
* Get domain search history
|
||||||
*/
|
*/
|
||||||
export const getSearchHistory = async (): Promise<DomainSearchHistory[]> => {
|
export const getSearchHistory = async (): Promise<DomainSearchHistory[]> => {
|
||||||
const response = await apiClient.get<DomainSearchHistory[]>('/api/domains/history/');
|
const response = await apiClient.get<DomainSearchHistory[]>('/domains/history/');
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export interface OAuthConnection {
|
|||||||
* Get list of enabled OAuth providers
|
* Get list of enabled OAuth providers
|
||||||
*/
|
*/
|
||||||
export const getOAuthProviders = async (): Promise<OAuthProvider[]> => {
|
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;
|
return response.data.providers;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ export const getOAuthProviders = async (): Promise<OAuthProvider[]> => {
|
|||||||
*/
|
*/
|
||||||
export const initiateOAuth = async (provider: string): Promise<OAuthAuthorizationResponse> => {
|
export const initiateOAuth = async (provider: string): Promise<OAuthAuthorizationResponse> => {
|
||||||
const response = await apiClient.get<OAuthAuthorizationResponse>(
|
const response = await apiClient.get<OAuthAuthorizationResponse>(
|
||||||
`/api/auth/oauth/${provider}/authorize/`
|
`/auth/oauth/${provider}/authorize/`
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
@@ -68,7 +68,7 @@ export const handleOAuthCallback = async (
|
|||||||
state: string
|
state: string
|
||||||
): Promise<OAuthTokenResponse> => {
|
): Promise<OAuthTokenResponse> => {
|
||||||
const response = await apiClient.post<OAuthTokenResponse>(
|
const response = await apiClient.post<OAuthTokenResponse>(
|
||||||
`/api/auth/oauth/${provider}/callback/`,
|
`/auth/oauth/${provider}/callback/`,
|
||||||
{
|
{
|
||||||
code,
|
code,
|
||||||
state,
|
state,
|
||||||
@@ -81,7 +81,7 @@ export const handleOAuthCallback = async (
|
|||||||
* Get user's connected OAuth accounts
|
* Get user's connected OAuth accounts
|
||||||
*/
|
*/
|
||||||
export const getOAuthConnections = async (): Promise<OAuthConnection[]> => {
|
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;
|
return response.data.connections;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -89,5 +89,5 @@ export const getOAuthConnections = async (): Promise<OAuthConnection[]> => {
|
|||||||
* Disconnect an OAuth account
|
* Disconnect an OAuth account
|
||||||
*/
|
*/
|
||||||
export const disconnectOAuth = async (provider: string): Promise<void> => {
|
export const disconnectOAuth = async (provider: string): Promise<void> => {
|
||||||
await apiClient.delete(`/api/auth/oauth/connections/${provider}/`);
|
await apiClient.delete(`/auth/oauth/connections/${provider}/`);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export interface PlatformUser {
|
|||||||
* Get all businesses (platform admin only)
|
* Get all businesses (platform admin only)
|
||||||
*/
|
*/
|
||||||
export const getBusinesses = async (): Promise<PlatformBusiness[]> => {
|
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;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ export const updateBusiness = async (
|
|||||||
data: PlatformBusinessUpdate
|
data: PlatformBusinessUpdate
|
||||||
): Promise<PlatformBusiness> => {
|
): Promise<PlatformBusiness> => {
|
||||||
const response = await apiClient.patch<PlatformBusiness>(
|
const response = await apiClient.patch<PlatformBusiness>(
|
||||||
`/api/platform/businesses/${businessId}/`,
|
`/platform/businesses/${businessId}/`,
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -108,7 +108,7 @@ export const createBusiness = async (
|
|||||||
data: PlatformBusinessCreate
|
data: PlatformBusinessCreate
|
||||||
): Promise<PlatformBusiness> => {
|
): Promise<PlatformBusiness> => {
|
||||||
const response = await apiClient.post<PlatformBusiness>(
|
const response = await apiClient.post<PlatformBusiness>(
|
||||||
'/api/platform/businesses/',
|
'/platform/businesses/',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -118,7 +118,7 @@ export const createBusiness = async (
|
|||||||
* Get all users (platform admin only)
|
* Get all users (platform admin only)
|
||||||
*/
|
*/
|
||||||
export const getUsers = async (): Promise<PlatformUser[]> => {
|
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;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ export const getUsers = async (): Promise<PlatformUser[]> => {
|
|||||||
* Get users for a specific business
|
* Get users for a specific business
|
||||||
*/
|
*/
|
||||||
export const getBusinessUsers = async (businessId: number): Promise<PlatformUser[]> => {
|
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;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ export interface TenantInvitationAccept {
|
|||||||
* Get all tenant invitations (platform admin only)
|
* Get all tenant invitations (platform admin only)
|
||||||
*/
|
*/
|
||||||
export const getTenantInvitations = async (): Promise<TenantInvitation[]> => {
|
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;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ export const createTenantInvitation = async (
|
|||||||
data: TenantInvitationCreate
|
data: TenantInvitationCreate
|
||||||
): Promise<TenantInvitation> => {
|
): Promise<TenantInvitation> => {
|
||||||
const response = await apiClient.post<TenantInvitation>(
|
const response = await apiClient.post<TenantInvitation>(
|
||||||
'/api/platform/tenant-invitations/',
|
'/platform/tenant-invitations/',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -230,14 +230,14 @@ export const createTenantInvitation = async (
|
|||||||
* Resend a tenant invitation (platform admin only)
|
* Resend a tenant invitation (platform admin only)
|
||||||
*/
|
*/
|
||||||
export const resendTenantInvitation = async (invitationId: number): Promise<void> => {
|
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)
|
* Cancel a tenant invitation (platform admin only)
|
||||||
*/
|
*/
|
||||||
export const cancelTenantInvitation = async (invitationId: number): Promise<void> => {
|
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> => {
|
export const getInvitationByToken = async (token: string): Promise<TenantInvitationDetail> => {
|
||||||
const response = await apiClient.get<TenantInvitationDetail>(
|
const response = await apiClient.get<TenantInvitationDetail>(
|
||||||
`/api/platform/tenant-invitations/token/${token}/`
|
`/platform/tenant-invitations/token/${token}/`
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
@@ -258,7 +258,7 @@ export const acceptInvitation = async (
|
|||||||
data: TenantInvitationAccept
|
data: TenantInvitationAccept
|
||||||
): Promise<{ detail: string }> => {
|
): Promise<{ detail: string }> => {
|
||||||
const response = await apiClient.post<{ detail: string }>(
|
const response = await apiClient.post<{ detail: string }>(
|
||||||
`/api/platform/tenant-invitations/token/${token}/accept/`,
|
`/platform/tenant-invitations/token/${token}/accept/`,
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
return response.data;
|
return response.data;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export interface SandboxResetResponse {
|
|||||||
* Get current sandbox mode status
|
* Get current sandbox mode status
|
||||||
*/
|
*/
|
||||||
export const getSandboxStatus = async (): Promise<SandboxStatus> => {
|
export const getSandboxStatus = async (): Promise<SandboxStatus> => {
|
||||||
const response = await apiClient.get<SandboxStatus>('/api/sandbox/status/');
|
const response = await apiClient.get<SandboxStatus>('/sandbox/status/');
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ export const getSandboxStatus = async (): Promise<SandboxStatus> => {
|
|||||||
* Toggle between live and sandbox mode
|
* Toggle between live and sandbox mode
|
||||||
*/
|
*/
|
||||||
export const toggleSandboxMode = async (enableSandbox: boolean): Promise<SandboxToggleResponse> => {
|
export const toggleSandboxMode = async (enableSandbox: boolean): Promise<SandboxToggleResponse> => {
|
||||||
const response = await apiClient.post<SandboxToggleResponse>('/api/sandbox/toggle/', {
|
const response = await apiClient.post<SandboxToggleResponse>('/sandbox/toggle/', {
|
||||||
sandbox: enableSandbox,
|
sandbox: enableSandbox,
|
||||||
});
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
@@ -43,6 +43,6 @@ export const toggleSandboxMode = async (enableSandbox: boolean): Promise<Sandbox
|
|||||||
* Reset sandbox data to initial state
|
* Reset sandbox data to initial state
|
||||||
*/
|
*/
|
||||||
export const resetSandboxData = async (): Promise<SandboxResetResponse> => {
|
export const resetSandboxData = async (): Promise<SandboxResetResponse> => {
|
||||||
const response = await apiClient.post<SandboxResetResponse>('/api/sandbox/reset/');
|
const response = await apiClient.post<SandboxResetResponse>('/sandbox/reset/');
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user