CST-12174 Added filters for empty string patterns removal

This commit is contained in:
Mattia Vianelli
2023-10-25 21:41:11 +02:00
parent c93c2a6234
commit 90652b62ce

View File

@@ -131,18 +131,12 @@ export class LdnServiceFormComponent implements OnInit {
return;
}
this.formModel.value.notifyServiceInboundPatterns = this.formModel.value.notifyServiceInboundPatterns.filter((pattern: { pattern: string; }) => pattern.pattern !== '');
this.formModel.value.notifyServiceOutboundPatterns = this.formModel.value.notifyServiceOutboundPatterns.filter((pattern: { pattern: string; }) => pattern.pattern !== '');
console.log(this.formModel.value);
const values = this.formModel.value;
const inboundPatternValue = this.formModel.get('inboundPattern').value;
const outboundPatternValue = this.formModel.get('outboundPattern').value;
if (inboundPatternValue === '') {
values.notifyServiceInboundPatterns = [];
}
if (outboundPatternValue === '') {
values.notifyServiceOutboundPatterns = [];
}
const ldnServiceData = this.ldnServicesService.create(values);
ldnServiceData.pipe(