Swift field was not filled when iban was changed

This commit is contained in:
Joan 2018-11-22 12:10:43 +01:00
parent 98429a95f7
commit 45920f9673
4 changed files with 3 additions and 5 deletions

View File

@ -89,8 +89,8 @@ export default class Controller {
let json = encodeURIComponent(JSON.stringify(filter));
this.client.bankEntityFk = undefined;
this.$http.get(`/client/api/BankEntities?filter=${json}`).then(response => {
if (response.data)
this.client.bankEntityFk = response.data.id;
if (response.data && response.data[0])
this.client.bankEntityFk = response.data[0].id;
});
}
}

View File

@ -128,7 +128,7 @@ describe('Client', () => {
let expectedFilter = {where: {id: 128}};
let json = encodeURIComponent(JSON.stringify(expectedFilter));
$httpBackend.when('GET', `/client/api/BankEntities?filter=${json}`).respond({id: 128});
$httpBackend.when('GET', `/client/api/BankEntities?filter=${json}`).respond([{id: 128}]);
$httpBackend.expect('GET', `/client/api/BankEntities?filter=${json}`);
controller.autofillBic();
$httpBackend.flush();

View File

@ -3,7 +3,6 @@ import ngModule from '../../module';
export default class Controller {
constructor($element) {
this.$element = $element;
console.log($element);
this.input = $element[0].querySelector('input');
}

View File

@ -112,7 +112,6 @@ class Controller {
let offsetTop;
if (this.ticketFk) {
console.log(selectedTicketLineIndex);
let selectedTicketLine = lines[selectedTicketLineIndex];
let id = selectedTicketLine.querySelector('.id');
id.classList.add('counter');