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