Skip to content

Commit

Permalink
updating uploads helper
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jan 11, 2024
1 parent bebd15e commit 60af2d7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Rest/Routes/AbstractUtilsBaseRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,13 @@ static function ($item) {
// All other "normal" fields.
$fieldType = $value['type'] ?? '';
$fieldValue = $value['value'] ?? '';
$fieldName = $value['name'] ?? '';

if (!$fieldName) {
break;
}

// File.
if ($fieldType === 'file') {
$output['files'][$key] = $fieldValue ? \array_merge(
$value,
Expand All @@ -292,10 +298,17 @@ function ($item) {
break;
}

// Rating.
if ($fieldType === 'rating' && $fieldValue === '0') {
$value['value'] = '';
}

// Checkbox.
if ($fieldType === 'checkbox') {
$fieldValue = \explode(UtilsConfig::DELIMITER, $fieldValue);
}

$output['paramsRaw'][$fieldName] = $fieldValue;
$output['params'][$key] = $value;

break;
Expand Down

0 comments on commit 60af2d7

Please sign in to comment.