Ensure pacode being appended to links in ajax generated tables

This commit is contained in:
Björn Fromme
2019-10-24 14:14:38 +02:00
parent c9c03abcde
commit 9fa7529fc2
3 changed files with 12 additions and 9 deletions
@@ -94,10 +94,12 @@ class AjaxDateController extends ActionController
/**
* @param Product $product
* @param Hotel $hotel
* @param string $paCode
*
* @return string
* @throws \Doctrine\DBAL\DBALException
*/
public function datesAction(Product $product, Hotel $hotel = null)
public function datesAction(Product $product, Hotel $hotel = null, $paCode = null)
{
if ($hotel === null) {
return json_encode([
@@ -128,8 +130,6 @@ class AjaxDateController extends ActionController
}
if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
$paCode = $reseller['paCode'];
} else {
$paCode = null;
}
$datesTable = $this->dateService->getDatesTable([
'product' => $product,
@@ -85,6 +85,7 @@ class AjaxTableController extends ActionController
* @param Product $product
* @param Hotel $hotel
* @param Date $date
* @param string $paCode
*
* @return string
* @throws \Doctrine\DBAL\DBALException
@@ -93,16 +94,14 @@ class AjaxTableController extends ActionController
(
Product $product,
Hotel $hotel,
Date $date = null
)
{
Date $date = null,
$paCode = null
) {
$forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true);
$filterSettings = $this->filterService->getDefaultFilterSettings($forcedConceptUids, false);
if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
$paCode = $reseller['paCode'];
} else {
$paCode = null;
}
$priceTable = $this->dateService->getPriceTable([
'product' => $product,
@@ -93,7 +93,10 @@
this.detailShow = false;
axios({
url: this.uris['dates'],
method: 'post'
method: 'post',
data: {
paCode: this.$store.state.config.paCode
}
}).then(response => {
const json = response.data;
if (json.dates.length === 1) {
@@ -131,6 +134,7 @@
this.detailShow = false;
let query = {};
query[this.argumentPrefix + '[date]'] = dateUid;
query[this.argumentPrefix + '[paCode]'] = this.$store.state.config.paCode;
axios({
url: this.uris['pricetable'],
method: 'post',