Bug 34431: (QA follow-up) Fix duplicate backend options

Prevent adding backend option if the option already exists

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2023-08-31 08:57:20 +00:00 committed by Katrin Fischer
parent ec28e4c958
commit c529e53b89
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 6 additions and 5 deletions

View File

@ -533,10 +533,12 @@ $(document).ready(function() {
},
success: function(backends){
backends.sort((a, b) => a.ill_backend_id.localeCompare(b.ill_backend_id)).forEach(function(backend) {
$('#illfilter_backend').append(
'<option value="' + backend.ill_backend_id +
'">' + backend.ill_backend_id + '</option>'
);
if( $('#illfilter_backend option[value=' + backend.ill_backend_id + ']').length == 0 ){
$('#illfilter_backend').append(
'<option value="' + backend.ill_backend_id +
'">' + backend.ill_backend_id + '</option>'
);
}
});
let all_existing_statuses = [];
@ -569,7 +571,6 @@ $(document).ready(function() {
}
}
)
}
});
}