Commit f6997f74 authored by Florian Azizian's avatar Florian Azizian

FIX #10180 TIME 0:30 check if more than one dest

parent fcbd4976
......@@ -424,7 +424,11 @@ class ListTemplateController
ValidatorModel::notEmpty($aArgs, ['items']);
ValidatorModel::arrayType($aArgs, ['items']);
$destFound = false;
foreach ($aArgs['items'] as $item) {
if ($destFound && $item['item_mode'] == 'dest') {
return ['errors' => 'More than one dest not allowed'];
}
if (empty($item['item_id'])) {
return ['errors' => 'Item_id is empty'];
}
......@@ -434,6 +438,9 @@ class ListTemplateController
if (empty($item['item_mode'])) {
return ['errors' => 'Item_mode is empty'];
}
if ($item['item_mode'] == 'dest') {
$destFound = true;
}
}
return ['success' => 'success'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment