Skip to content

Commit b305f63

Browse files
committed
fix(arc-saas): if empty feature Default value will show
if empty feature Default value will show
1 parent 20c204f commit b305f63

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

projects/saas-ui/src/app/main/components/add-plan/add-plan.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,21 @@ export class AddPlanComponent implements OnInit {
252252
const featuresGroup = this.addPlanForm.get('features') as FormGroup;
253253
const selectedFeatures = featuresGroup
254254
? Object.keys(featuresGroup.controls)
255-
.filter(
256-
key =>
257-
featuresGroup.get(key)?.value !== null &&
258-
featuresGroup.get(key)?.value !== '',
259-
)
255+
// .filter(
256+
// key =>
257+
// featuresGroup.get(key)?.value !== null &&
258+
// featuresGroup.get(key)?.value !== '',
259+
// )
260260
.reduce(
261261
(acc, key) => {
262262
const feature = this.featureValue.features.find(
263263
f => (f as any).key === key,
264264
);
265265
if (feature) {
266+
const featureVal = featuresGroup.get(key)?.value;
266267
acc[feature.id] = {
267268
id: (feature.value as any)?.id,
268-
value: featuresGroup.get(key)?.value,
269+
value: featureVal || feature.defaultValue || '',
269270
};
270271
}
271272
return acc;

0 commit comments

Comments
 (0)