expand sub tasks
This commit is contained in:
@@ -112,7 +112,7 @@ export const adminCenterApiService = {
|
||||
|
||||
async updateTeam(
|
||||
team_id: string,
|
||||
body: {name: string, teamMembers: IOrganizationUser[]}
|
||||
body: { name: string; teamMembers: IOrganizationUser[] }
|
||||
): Promise<IServerResponse<IOrganization>> {
|
||||
const response = await apiClient.put<IServerResponse<IOrganization>>(
|
||||
`${rootUrl}/organization/team/${team_id}`,
|
||||
@@ -152,7 +152,6 @@ export const adminCenterApiService = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
|
||||
// Billing - Configuration
|
||||
async getCountries(): Promise<IServerResponse<IBillingConfigurationCountry[]>> {
|
||||
const response = await apiClient.get<IServerResponse<IBillingConfigurationCountry[]>>(
|
||||
@@ -168,7 +167,9 @@ export const adminCenterApiService = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async updateBillingConfiguration(body: IBillingConfiguration): Promise<IServerResponse<IBillingConfiguration>> {
|
||||
async updateBillingConfiguration(
|
||||
body: IBillingConfiguration
|
||||
): Promise<IServerResponse<IBillingConfiguration>> {
|
||||
const response = await apiClient.put<IServerResponse<IBillingConfiguration>>(
|
||||
`${rootUrl}/billing/configuration`,
|
||||
body
|
||||
@@ -178,42 +179,58 @@ export const adminCenterApiService = {
|
||||
|
||||
// Billing - Current Bill
|
||||
async getCharges(): Promise<IServerResponse<IBillingChargesResponse>> {
|
||||
const response = await apiClient.get<IServerResponse<IBillingChargesResponse>>(`${rootUrl}/billing/charges`);
|
||||
const response = await apiClient.get<IServerResponse<IBillingChargesResponse>>(
|
||||
`${rootUrl}/billing/charges`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getTransactions(): Promise<IServerResponse<IBillingTransaction[]>> {
|
||||
const response = await apiClient.get<IServerResponse<IBillingTransaction[]>>(`${rootUrl}/billing/transactions`);
|
||||
const response = await apiClient.get<IServerResponse<IBillingTransaction[]>>(
|
||||
`${rootUrl}/billing/transactions`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getBillingAccountInfo(): Promise<IServerResponse<IBillingAccountInfo>> {
|
||||
const response = await apiClient.get<IServerResponse<IBillingAccountInfo>>(`${rootUrl}/billing/info`);
|
||||
const response = await apiClient.get<IServerResponse<IBillingAccountInfo>>(
|
||||
`${rootUrl}/billing/info`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getFreePlanSettings(): Promise<IServerResponse<IFreePlanSettings>> {
|
||||
const response = await apiClient.get<IServerResponse<IFreePlanSettings>>(`${rootUrl}/billing/free-plan`);
|
||||
const response = await apiClient.get<IServerResponse<IFreePlanSettings>>(
|
||||
`${rootUrl}/billing/free-plan`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async upgradePlan(plan: string): Promise<IServerResponse<IUpgradeSubscriptionPlanResponse>> {
|
||||
const response = await apiClient.get<IServerResponse<IUpgradeSubscriptionPlanResponse>>(`${rootUrl}/billing/upgrade-plan${toQueryString({plan})}`);
|
||||
const response = await apiClient.get<IServerResponse<IUpgradeSubscriptionPlanResponse>>(
|
||||
`${rootUrl}/billing/upgrade-plan${toQueryString({ plan })}`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async changePlan(plan: string): Promise<IServerResponse<IUpgradeSubscriptionPlanResponse>> {
|
||||
const response = await apiClient.get<IServerResponse<IUpgradeSubscriptionPlanResponse>>(`${rootUrl}/billing/change-plan${toQueryString({plan})}`);
|
||||
const response = await apiClient.get<IServerResponse<IUpgradeSubscriptionPlanResponse>>(
|
||||
`${rootUrl}/billing/change-plan${toQueryString({ plan })}`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getPlans(): Promise<IServerResponse<IPricingPlans>> {
|
||||
const response = await apiClient.get<IServerResponse<IPricingPlans>>(`${rootUrl}/billing/plans`);
|
||||
const response = await apiClient.get<IServerResponse<IPricingPlans>>(
|
||||
`${rootUrl}/billing/plans`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getStorageInfo(): Promise<IServerResponse<IStorageInfo>> {
|
||||
const response = await apiClient.get<IServerResponse<IStorageInfo>>(`${rootUrl}/billing/storage`);
|
||||
const response = await apiClient.get<IServerResponse<IStorageInfo>>(
|
||||
`${rootUrl}/billing/storage`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -225,7 +242,7 @@ export const adminCenterApiService = {
|
||||
async resumeSubscription(): Promise<IServerResponse<any>> {
|
||||
const response = await apiClient.get<IServerResponse<any>>(`${rootUrl}/billing/resume-plan`);
|
||||
return response.data;
|
||||
},
|
||||
},
|
||||
|
||||
async cancelSubscription(): Promise<IServerResponse<any>> {
|
||||
const response = await apiClient.get<IServerResponse<any>>(`${rootUrl}/billing/cancel-plan`);
|
||||
@@ -233,26 +250,34 @@ export const adminCenterApiService = {
|
||||
},
|
||||
|
||||
async addMoreSeats(totalSeats: number): Promise<IServerResponse<any>> {
|
||||
const response = await apiClient.post<IServerResponse<any>>(`${rootUrl}/billing/purchase-more-seats`, {seatCount: totalSeats});
|
||||
const response = await apiClient.post<IServerResponse<any>>(
|
||||
`${rootUrl}/billing/purchase-more-seats`,
|
||||
{ seatCount: totalSeats }
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async redeemCode(code: string): Promise<IServerResponse<IUpgradeSubscriptionPlanResponse>> {
|
||||
const response = await apiClient.post<IServerResponse<IUpgradeSubscriptionPlanResponse>>(`${rootUrl}/billing/redeem`, {
|
||||
code,
|
||||
});
|
||||
const response = await apiClient.post<IServerResponse<IUpgradeSubscriptionPlanResponse>>(
|
||||
`${rootUrl}/billing/redeem`,
|
||||
{
|
||||
code,
|
||||
}
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getAccountStorage(): Promise<IServerResponse<IBillingAccountStorage>> {
|
||||
const response = await apiClient.get<IServerResponse<IBillingAccountStorage>>(`${rootUrl}/billing/account-storage`);
|
||||
const response = await apiClient.get<IServerResponse<IBillingAccountStorage>>(
|
||||
`${rootUrl}/billing/account-storage`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async switchToFreePlan(teamId: string): Promise<IServerResponse<any>> {
|
||||
const response = await apiClient.get<IServerResponse<any>>(`${rootUrl}/billing/switch-to-free-plan/${teamId}`);
|
||||
const response = await apiClient.get<IServerResponse<any>>(
|
||||
`${rootUrl}/billing/switch-to-free-plan/${teamId}`
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user