diff --git a/api/index.php b/api/index.php index 7536027..f1144da 100644 --- a/api/index.php +++ b/api/index.php @@ -12084,7 +12084,7 @@ function familySiblingSuggest(PDO $db): void { // ===== CUSTOM LOCATIONS ===== function locationsList(PDO $db): void { - $rows = $db->query("SELECT key, label, icon, sort_order, is_builtin FROM locations ORDER BY sort_order ASC, id ASC")->fetchAll(); + $rows = $db->query("SELECT key, label, icon, sort_order, is_builtin FROM locations ORDER BY label COLLATE NOCASE ASC")->fetchAll(); echo json_encode(['success' => true, 'locations' => $rows]); } @@ -12181,7 +12181,7 @@ function locationsUpdate(PDO $db): void { } function subcategoriesList(PDO $db): void { - $rows = $db->query("SELECT id, category, key, label, sort_order FROM subcategories ORDER BY category ASC, sort_order ASC, id ASC")->fetchAll(); + $rows = $db->query("SELECT id, category, key, label, sort_order FROM subcategories ORDER BY category ASC, label COLLATE NOCASE ASC")->fetchAll(); echo json_encode(['success' => true, 'subcategories' => $rows]); } @@ -12270,7 +12270,7 @@ function subcategoriesUpdate(PDO $db): void { } function categoriesList(PDO $db): void { - $rows = $db->query("SELECT key, label, icon, keywords, sort_order, is_builtin FROM categories ORDER BY sort_order ASC, id ASC")->fetchAll(); + $rows = $db->query("SELECT key, label, icon, keywords, sort_order, is_builtin FROM categories ORDER BY label COLLATE NOCASE ASC")->fetchAll(); echo json_encode(['success' => true, 'categories' => $rows]); } @@ -12519,7 +12519,7 @@ function recipeTagsUpdate(PDO $db): void { } function customUnitsList(PDO $db): void { - $rows = $db->query("SELECT id, key, label, icon, base_unit, factor, sort_order FROM custom_units ORDER BY sort_order ASC, id ASC")->fetchAll(); + $rows = $db->query("SELECT id, key, label, icon, base_unit, factor, sort_order FROM custom_units ORDER BY label COLLATE NOCASE ASC")->fetchAll(); echo json_encode(['success' => true, 'units' => $rows]); }