4496-entry.buy_import #1047
|
@ -20,7 +20,7 @@ module.exports = Self => {
|
||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
path: `/:id/importBuysPreview`,
|
path: `/:id/importBuysPreview`,
|
||||||
verb: 'GET'
|
verb: 'POST'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Controller extends Section {
|
||||||
fetchBuys(buys) {
|
fetchBuys(buys) {
|
||||||
const params = {buys};
|
const params = {buys};
|
||||||
const query = `Entries/${this.$params.id}/importBuysPreview`;
|
const query = `Entries/${this.$params.id}/importBuysPreview`;
|
||||||
this.$http.get(query, {params}).then(res => {
|
this.$http.post(query, params).then(res => {
|
||||||
this.import.buys = res.data;
|
this.import.buys = res.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,9 +111,8 @@ describe('Entry', () => {
|
||||||
'volume': 1125}
|
'volume': 1125}
|
||||||
];
|
];
|
||||||
|
|
||||||
const serializedParams = $httpParamSerializer({buys});
|
const query = `Entries/1/importBuysPreview`;
|
||||||
const query = `Entries/1/importBuysPreview?${serializedParams}`;
|
$httpBackend.expectPOST(query).respond(200, buys);
|
||||||
$httpBackend.expectGET(query).respond(200, buys);
|
|
||||||
controller.fetchBuys(buys);
|
controller.fetchBuys(buys);
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue