Skip to content

Commit

Permalink
updating block admin enque
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jan 17, 2024
1 parent 29c3bf5 commit 1e2a88e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Helpers/UtilsApiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,16 @@ public static function getIntegrationApiPublicOutput(array $formDetails, string

$additionalOutput = [];

$allowedOutput = [
UtilsConfig::FD_SUCCESS_REDIRECT => UtilsHelper::getStateResponseOutputKey('successRedirect'),
UtilsConfig::FD_ADDON => UtilsHelper::getStateResponseOutputKey('addon'),
UtilsConfig::IARD_VALIDATION => UtilsHelper::getStateResponseOutputKey('validation'),
];
if (isset($formDetails[UtilsConfig::FD_SUCCESS_REDIRECT])) {
$additionalOutput[UtilsHelper::getStateResponseOutputKey('successRedirect')] = $formDetails[UtilsConfig::FD_SUCCESS_REDIRECT];
}

// Populate additional output with allowed keys and aproppriate allowed output keys used in JS.
foreach ($allowedOutput as $key => $value) {
if (isset($response[$key])) {
$additionalOutput[$value] = $response[$value];
}
if (isset($formDetails[UtilsConfig::FD_ADDON])) {
$additionalOutput[UtilsHelper::getStateResponseOutputKey('addon')] = $formDetails[UtilsConfig::FD_ADDON];
}

if (isset($response[UtilsConfig::IARD_VALIDATION])) {
$additionalOutput[UtilsHelper::getStateResponseOutputKey('validation')] = $response[UtilsConfig::IARD_VALIDATION];
}

if ($status === UtilsConfig::STATUS_SUCCESS) {
Expand Down

0 comments on commit 1e2a88e

Please sign in to comment.