aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/lib/Controller
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-02-22 17:16:32 +0100
committerskjnldsv <skjnldsv@protonmail.com>2024-02-23 21:59:02 +0100
commitdd7fba2c95ba6cc495e4f31a4f21e9409d85e10e (patch)
tree972f7e55403677903c101e0bd00ca77fd173efcf /apps/settings/lib/Controller
parent52072741486447195d1c1852320cc29592a5ef36 (diff)
downloadnextcloud-server-dd7fba2c95ba6cc495e4f31a4f21e9409d85e10e.tar.gz
nextcloud-server-dd7fba2c95ba6cc495e4f31a4f21e9409d85e10e.zip
fix(settings): Only use `id` in categories - drop duplicated `ident` property
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/settings/lib/Controller')
-rw-r--r--apps/settings/lib/Controller/AppSettingsController.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php
index 1e4387bdcfd..ac98677d0c9 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -184,17 +184,11 @@ class AppSettingsController extends Controller {
private function getAllCategories() {
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
- $formattedCategories = [];
$categories = $this->categoryFetcher->get();
- foreach ($categories as $category) {
- $formattedCategories[] = [
- 'id' => $category['id'],
- 'ident' => $category['id'],
- 'displayName' => $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'],
- ];
- }
-
- return $formattedCategories;
+ return array_map(fn ($category) => [
+ 'id' => $category['id'],
+ 'displayName' => $category['translations'][$currentLanguage]['name'] ?? $category['translations']['en']['name'],
+ ], $categories);
}
private function fetchApps() {