fixed typo
This commit is contained in:
parent
f734fc8c02
commit
8f5c7e3427
|
@ -26,7 +26,7 @@
|
||||||
</vn-date-picker>
|
</vn-date-picker>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
disabled="!$ctrl.clientFk || !$ctrl.landed"
|
disabled="!$ctrl.clientFk || !$ctrl.landed"
|
||||||
data="$ctrl._avaibleAgencies"
|
data="$ctrl._availableAgencies"
|
||||||
label="Agency"
|
label="Agency"
|
||||||
show-field="agency"
|
show-field="agency"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Controller {
|
||||||
|
|
||||||
set addressFk(value) {
|
set addressFk(value) {
|
||||||
this.ticket.addressFk = value;
|
this.ticket.addressFk = value;
|
||||||
this.getAvaibleAgencies();
|
this.getAvailableAgencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
get addressFk() {
|
get addressFk() {
|
||||||
|
@ -39,7 +39,7 @@ class Controller {
|
||||||
|
|
||||||
set landed(value) {
|
set landed(value) {
|
||||||
this.ticket.landed = value;
|
this.ticket.landed = value;
|
||||||
this.getAvaibleAgencies();
|
this.getAvailableAgencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
get landed() {
|
get landed() {
|
||||||
|
@ -50,14 +50,14 @@ class Controller {
|
||||||
return this.ticket.warehouseFk;
|
return this.ticket.warehouseFk;
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvaibleAgencies() {
|
getAvailableAgencies() {
|
||||||
this.ticket.agencyModeFk = null;
|
this.ticket.agencyModeFk = null;
|
||||||
if (this.ticket.landed && this.ticket.addressFk) {
|
if (this.ticket.landed && this.ticket.addressFk) {
|
||||||
let filter = {addressFk: this.ticket.addressFk, landed: this.ticket.landed};
|
let filter = {addressFk: this.ticket.addressFk, landed: this.ticket.landed};
|
||||||
filter = encodeURIComponent(JSON.stringify(filter));
|
filter = encodeURIComponent(JSON.stringify(filter));
|
||||||
let query = `/api/Agencies/landsThatDay?filter=${filter}`;
|
let query = `/api/Agencies/landsThatDay?filter=${filter}`;
|
||||||
this.$http.get(query).then(res => {
|
this.$http.get(query).then(res => {
|
||||||
this._avaibleAgencies = res.data[0];
|
this._availableAgencies = res.data[0];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ describe('Ticket', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getAvaibleAgencies()', () => {
|
describe('getAvailableAgencies()', () => {
|
||||||
it(`should make a query if landed and addressFk exists`, () => {
|
it(`should make a query if landed and addressFk exists`, () => {
|
||||||
controller.ticket.addressFk = 101;
|
controller.ticket.addressFk = 101;
|
||||||
controller.ticket.landed = 101;
|
controller.ticket.landed = 101;
|
||||||
|
@ -48,7 +48,7 @@ describe('Ticket', () => {
|
||||||
$httpBackend.whenGET(`/api/Agencies/landsThatDay?filter=${filter}`).respond({data: 1});
|
$httpBackend.whenGET(`/api/Agencies/landsThatDay?filter=${filter}`).respond({data: 1});
|
||||||
$httpBackend.expectGET(`/api/Agencies/landsThatDay?filter=${filter}`);
|
$httpBackend.expectGET(`/api/Agencies/landsThatDay?filter=${filter}`);
|
||||||
|
|
||||||
controller.getAvaibleAgencies();
|
controller.getAvailableAgencies();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue