Skip to content
Snippets Groups Projects
Verified Commit 12f75c2a authored by Damien's avatar Damien
Browse files

FEAT #11947 TIME 0:20 Add public attribute to folders autocomplete

parent e4f3173d
No related branches found
No related tags found
No related merge requests found
......@@ -698,19 +698,21 @@ class AutoCompleteController
$arrScopedFoldersIds = array_column($scopedFolders, 'id');
$selectedFolders = FolderModel::get([
'where' => ['label ilike ? AND id IN(?)'],
'where' => ['label ilike ? AND id in (?)'],
'data' => [ '%'.$data['search'].'%', $arrScopedFoldersIds],
'orderBy' => ['label']
]);
$getFomatedFolders = function ($value) {
return $return = [
'id' => $value['id'],
'idToDisplay' => $value['label'],
'otherInfo' => ''
$data = [];
foreach ($selectedFolders as $value) {
$data[] = [
'id' => $value['id'],
'idToDisplay' => $value['label'],
'otherInfo' => $value['public']
];
};
return $response->withJson(array_map($getFomatedFolders, $selectedFolders));
}
return $response->withJson($data);
}
public static function getTags(Request $request, Response $response)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment