mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 14:52:09 +03:00
fix(combos): include id column in getCombos query (#8905)
getCombos() SELECT was missing the id column, so returned combo objects had their id come only from the JSON data blob. If the data blob lacked an id field, callers (including the Dashboard) saw null — making the combo appear to have no primary key and impossible to delete. Add id to the SELECT so the database column value is always available. Signed-off-by: Minxi Hou <houminxi@gmail.com>
This commit is contained in:
@@ -96,7 +96,7 @@ function getNextSortOrder() {
|
||||
export async function getCombos(limit?: number, offset?: number) {
|
||||
const db = getDbInstance();
|
||||
let sql =
|
||||
"SELECT data, sort_order, context_cache_protection FROM combos ORDER BY sort_order ASC, name COLLATE NOCASE ASC";
|
||||
"SELECT id, data, sort_order, context_cache_protection FROM combos ORDER BY sort_order ASC, name COLLATE NOCASE ASC";
|
||||
const params: unknown[] = [];
|
||||
if (limit !== undefined) {
|
||||
sql += " LIMIT ? OFFSET ?";
|
||||
|
||||
Reference in New Issue
Block a user