Merge pull request '4496-entry.buy_import' (#1047) from 4496-entry.buy_import into dev
gitea/salix/pipeline/head There was a failure building this commit Details

Reviewed-on: #1047
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2022-09-13 09:58:27 +00:00
commit 4965bfd923
3 changed files with 4 additions and 5 deletions

View File

@ -20,7 +20,7 @@ module.exports = Self => {
},
http: {
path: `/:id/importBuysPreview`,
verb: 'GET'
verb: 'POST'
}
});

View File

@ -58,7 +58,7 @@ class Controller extends Section {
fetchBuys(buys) {
const params = {buys};
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;
});
}

View File

@ -111,9 +111,8 @@ describe('Entry', () => {
'volume': 1125}
];
const serializedParams = $httpParamSerializer({buys});
const query = `Entries/1/importBuysPreview?${serializedParams}`;
$httpBackend.expectGET(query).respond(200, buys);
const query = `Entries/1/importBuysPreview`;
$httpBackend.expectPOST(query).respond(200, buys);
controller.fetchBuys(buys);
$httpBackend.flush();