Skip to content

Commit 2f52fdb

Browse files
committed
fix(arc-saas): changes in component manage plans
changes in component manage plans GH-64
1 parent 7bff46a commit 2f52fdb

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

projects/saas-ui/src/app/main/components/manage-plans/manage-plans.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
}
1212
}
1313

14-
1514
.heading-wrapper {
1615
display: flex;
1716
justify-content: space-between;
1817
align-items: center;
19-
}
18+
}

projects/saas-ui/src/app/main/components/manage-plans/manage-plans.component.ts

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class ManagePlansComponent extends RouteComponentBaseDirective {
2727
[x: string]: any;
2828
gridApi: GridApi;
2929
gridOptions: GridOptions;
30+
getResp: any;
3031
limit = 5;
3132
colDefs: ColDef[] = [
3233
{field: 'name', headerName: 'Plan Name', width: 200, minWidth: 20},
@@ -96,19 +97,32 @@ export class ManagePlansComponent extends RouteComponentBaseDirective {
9697
limit: limit,
9798
include: [{relation: 'currency'}, {relation: 'billingCycle'}],
9899
};
100+
99101
return this.billingPlanService.getPlanOptions(filter).pipe(
100102
map(res => {
101-
const rows = res.map(item => {
102-
return {
103-
id: item.id,
104-
name: item.name,
105-
description: item.description,
106-
cycleName: item['billingCycle'].cycleName,
107-
currencyName: item['currency'].currencyName,
108-
price: item.price,
109-
};
110-
});
111-
return rows;
103+
try {
104+
const body = JSON.parse(JSON.stringify(res)).body;
105+
this.getResp = body;
106+
const rows = body.map(item => {
107+
return {
108+
id: item.id,
109+
name: item.name,
110+
description: item.description,
111+
cycleName: item['billingCycle']
112+
? item['billingCycle'].cycleName
113+
: '',
114+
currencyName: item['currency']
115+
? item['currency'].currencyName
116+
: '',
117+
price: item.price,
118+
};
119+
});
120+
121+
return rows;
122+
} catch (error) {
123+
console.error('Error processing response:', error);
124+
return [];
125+
}
112126
}),
113127
);
114128
}

projects/saas-ui/src/app/on-boarding/commands/get-plan.command.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export class GetPlanCommand<T> extends GetAPICommand<AnyObject[]> {
1717
super(
1818
apiService,
1919
adapter,
20-
`https://arc-saas.net/subscription-service/plans`,
20+
`${appConfig.baseApiUrl}${appConfig.subscriptionServiceUrl}/plans`,
2121
);
2222
}
2323
}
24-
// `${appConfig.baseApiUrl}${appConfig.subscriptionServiceUrl}/plans`,

0 commit comments

Comments
 (0)