mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
CST-12174 Added filters for empty string patterns removal
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user