From 8c6c7345cd58630ce291569c5df983eae5ca497a Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 13 Sep 2022 10:27:08 +0200 Subject: [PATCH 1/2] fix: change GET by POST, to solve "Request Header Fields Too Large" --- modules/entry/back/methods/entry/importBuysPreview.js | 2 +- modules/entry/front/buy/import/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/entry/back/methods/entry/importBuysPreview.js b/modules/entry/back/methods/entry/importBuysPreview.js index 5b88b587c..730ecab0a 100644 --- a/modules/entry/back/methods/entry/importBuysPreview.js +++ b/modules/entry/back/methods/entry/importBuysPreview.js @@ -20,7 +20,7 @@ module.exports = Self => { }, http: { path: `/:id/importBuysPreview`, - verb: 'GET' + verb: 'POST' } }); diff --git a/modules/entry/front/buy/import/index.js b/modules/entry/front/buy/import/index.js index a2a28ef69..ba0a98e62 100644 --- a/modules/entry/front/buy/import/index.js +++ b/modules/entry/front/buy/import/index.js @@ -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; }); } From b02aa8466c86087429082a2605ac219e2fef8700 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 13 Sep 2022 10:27:17 +0200 Subject: [PATCH 2/2] fix: tfront --- modules/entry/front/buy/import/index.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/entry/front/buy/import/index.spec.js b/modules/entry/front/buy/import/index.spec.js index bf100dc83..036f52074 100644 --- a/modules/entry/front/buy/import/index.spec.js +++ b/modules/entry/front/buy/import/index.spec.js @@ -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();