Skip to content
Snippets Groups Projects
Commit b3098e0c authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX sve_start_date in first position

parent 5fd2d2a1
No related branches found
No related tags found
No related merge requests found
...@@ -765,11 +765,16 @@ class ResController ...@@ -765,11 +765,16 @@ class ResController
$select = explode(',', $data['select']); $select = explode(',', $data['select']);
$sve_start_date = false; $sve_start_date = false;
if ($keySve = array_search('sve_start_date', array_map('trim', $select))) { $keySve = array_search('sve_start_date', array_map('trim', $select));
if ($keySve !== false) {
unset($select[$keySve]); unset($select[$keySve]);
$sve_start_date = true; $sve_start_date = true;
} }
if ($sve_start_date && empty($select)) {
$select[] = 'res_id';
}
if (!PreparedClauseController::isRequestValid(['select' => $select, 'clause' => $data['clause'], 'orderBy' => $data['orderBy'], 'limit' => $data['limit'], 'userId' => $GLOBALS['userId']])) { if (!PreparedClauseController::isRequestValid(['select' => $select, 'clause' => $data['clause'], 'orderBy' => $data['orderBy'], 'limit' => $data['limit'], 'userId' => $GLOBALS['userId']])) {
return $response->withStatus(400)->withJson(['errors' => _INVALID_REQUEST]); return $response->withStatus(400)->withJson(['errors' => _INVALID_REQUEST]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment