Skip to content

Commit b1f1ede

Browse files
author
FalkWolsky
committed
Updating Subscriptions Pages
1 parent 3421fce commit b1f1ede

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

client/packages/lowcoder/src/api/subscriptionApi.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export type ResponseType = {
2525
response: any;
2626
};
2727

28-
const apiUrl = "https://flow.lowcoder.cloud/webhook/secure";
28+
const apiUrl = "http://localhost:8080/api/flow";
2929
const authHeader = "96a99c7b-3758-4c48-b4b1-a8cbf59e7d6c";
3030

3131
const currentPage = 1;
@@ -41,7 +41,7 @@ const getAxiosInstance = (clientSecret?: string) => {
4141

4242
const headers: Record<string, string> = {
4343
"Content-Type": "application/json",
44-
"Lowcoder-Token": authHeader,
44+
// "Lowcoder-Token": authHeader,
4545
}
4646

4747
const apiRequestConfig: AxiosRequestConfig = {
@@ -55,13 +55,12 @@ const getAxiosInstance = (clientSecret?: string) => {
5555

5656
class SubscriptionApi extends Api {
5757

58-
static async createCustomer(body: Customer): Promise<any> {
58+
static async createCustomer(body: any): Promise<any> {
5959
console.log("createCustomerCall", body);
6060

6161
let response;
6262
try {
6363
response = await getAxiosInstance().request({
64-
url: '/create-customer',
6564
method: "POST",
6665
withCredentials: true,
6766
data: body,

client/packages/lowcoder/src/pages/setting/settingHome.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ export function SettingHome() {
129129
!enableCustomBrand(config) ||
130130
(!isSelfDomain(config) && !isEnterpriseMode(config)),
131131
},
132-
// {
133-
// key: SettingPageEnum.Subscription,
134-
// label: trans("settings.subscription"),
135-
// icon: <SubscriptionIcon width={"20px"}/>,
136-
// },
132+
{
133+
key: SettingPageEnum.Subscription,
134+
label: trans("settings.subscription"),
135+
icon: <SubscriptionIcon width={"20px"}/>,
136+
},
137137
];
138138

139139
return (
@@ -161,7 +161,7 @@ export function SettingHome() {
161161
{selectKey === SettingPageEnum.Audit && <AuditSetting />}
162162
{selectKey === SettingPageEnum.Branding && <BrandingSetting />}
163163
{selectKey === SettingPageEnum.Advanced && <AdvancedSetting />}
164-
{/* {selectKey === SettingPageEnum.Subscription && <Subscription />} */}
164+
{selectKey === SettingPageEnum.Subscription && <Subscription />}
165165
</TwoColumnSettingPageContent>
166166
</>
167167
);

client/packages/lowcoder/src/pages/setting/subscriptions/subscriptionSetting.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,22 @@ export function SubscriptionSetting() {
7070
}
7171
};
7272

73+
const apiBody = {
74+
path: "webhook/echo",
75+
data: subscriptionCustomer,
76+
method: "post",
77+
headers: {
78+
"Lowcoder-Token": "96a99c7b-3758-4c48-b4b1-a8cbf59e7d6c",
79+
"Content-Type": "application/json"
80+
}
81+
}
82+
7383
const createCustomer = async () => {
84+
7485
console.log("createCustomerTry", subscriptionCustomer);
7586

7687
try {
77-
const result = await SubscriptionApi.createCustomer(subscriptionCustomer);
88+
const result = await SubscriptionApi.createCustomer(apiBody);
7889
if (result) {
7990
console.log("createCustomer", result);
8091
}

0 commit comments

Comments
 (0)