Don't include filtersettings when fetching date or pricetables

This commit is contained in:
Björn Fromme
2019-08-21 11:36:46 +02:00
parent c9dcdd57cb
commit 7a9855d916
3 changed files with 9 additions and 24 deletions
@@ -94,11 +94,10 @@ class AjaxDateController extends ActionController
/** /**
* @param Product $product * @param Product $product
* @param Hotel $hotel * @param Hotel $hotel
* @param FilterSettings $filterSettings
* *
* @return string * @return string
*/ */
public function datesAction(Product $product, Hotel $hotel = null, FilterSettings $filterSettings = null) public function datesAction(Product $product, Hotel $hotel = null)
{ {
if ($hotel === null) { if ($hotel === null) {
return json_encode([ return json_encode([
@@ -108,10 +107,10 @@ class AjaxDateController extends ActionController
'altLabel' => null, 'altLabel' => null,
]); ]);
} }
if ($filterSettings === null) {
$forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true);
$filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false); $filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false);
}
$altProductLink = null; $altProductLink = null;
$altLabel = null; $altLabel = null;
if ($product->getAltProduct()) { if ($product->getAltProduct()) {
@@ -28,7 +28,6 @@ namespace EP\EpProducts\Controller;
***************************************************************/ ***************************************************************/
use EP\EpProducts\Domain\Model\Date; use EP\EpProducts\Domain\Model\Date;
use EP\EpProducts\Domain\Model\FilterSettings;
use EP\EpProducts\Domain\Model\Hotel; use EP\EpProducts\Domain\Model\Hotel;
use EP\EpProducts\Domain\Model\Product; use EP\EpProducts\Domain\Model\Product;
use EP\EpProducts\Service\DateService; use EP\EpProducts\Service\DateService;
@@ -85,7 +84,6 @@ class AjaxTableController extends ActionController
/** /**
* @param Product $product * @param Product $product
* @param Hotel $hotel * @param Hotel $hotel
* @param FilterSettings $filterSettings
* @param Date $date * @param Date $date
* *
* @return string * @return string
@@ -95,14 +93,12 @@ class AjaxTableController extends ActionController
( (
Product $product, Product $product,
Hotel $hotel, Hotel $hotel,
FilterSettings $filterSettings = null,
Date $date = null Date $date = null
) )
{ {
if ($filterSettings === null) {
$forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true);
$filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false); $filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false);
}
if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) { if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
$paCode = $reseller['paCode']; $paCode = $reseller['paCode'];
} else { } else {
@@ -17,8 +17,6 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import 'dayjs/locale/de' import 'dayjs/locale/de'
import defaultFilterSettings from '../_filtersettings'
export default { export default {
components: { components: {
DatesTable, DatesTable,
@@ -51,7 +49,6 @@
loading: false, loading: false,
activeSection: null, activeSection: null,
singleDate: false, singleDate: false,
filterSettings: defaultFilterSettings,
referringPage: null referringPage: null
} }
}, },
@@ -92,12 +89,9 @@
this.datesShow = true; this.datesShow = true;
this.priceTableShow = false; this.priceTableShow = false;
this.detailShow = false; this.detailShow = false;
let query = {};
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
axios({ axios({
url: this.uris['dates'], url: this.uris['dates'],
method: 'post', method: 'post'
data: $.param(query)
}).then(response => { }).then(response => {
const json = response.data; const json = response.data;
if (json.dates.length === 1) { if (json.dates.length === 1) {
@@ -134,7 +128,6 @@
this.priceTableShow = true; this.priceTableShow = true;
this.detailShow = false; this.detailShow = false;
let query = {}; let query = {};
query[this.argumentPrefix + '[filterSettings]'] = this.filterSettings;
query[this.argumentPrefix + '[date]'] = dateUid; query[this.argumentPrefix + '[date]'] = dateUid;
axios({ axios({
url: this.uris['pricetable'], url: this.uris['pricetable'],
@@ -198,9 +191,6 @@
} }
}, },
created () { created () {
if (sessionStorage.getItem('filterSettings')) {
this.filterSettings = JSON.parse(sessionStorage.getItem('filterSettings'));
}
if (sessionStorage.getItem('referringPage')) { if (sessionStorage.getItem('referringPage')) {
this.referringPage = JSON.parse(sessionStorage.getItem('referringPage')); this.referringPage = JSON.parse(sessionStorage.getItem('referringPage'));
sessionStorage.removeItem('referringPage'); sessionStorage.removeItem('referringPage');