Fix catalog items missing due to page_id VARCHAR mismatch.
Use raw SQL for counts/loads/creates/moves so Habbo DBs with VARCHAR page_id and no AUTO_INCREMENT still show and persist furni. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
33a8a19820
commit
7bc0845932
6 files changed
+139
-79
No files matched your search
@@ -6,7 +6,7 @@ import {
|
||||
deletePage,
|
||||
getAncestors,
|
||||
getTreeFlat,
|
||||
safeItemCounts,
|
||||
getCatalogItemCounts,
|
||||
toInt,
|
||||
} from "@/lib/services/catalog-tree";
|
||||
import { rcon } from "@/lib/services/rcon";
|
||||
@@ -158,7 +158,7 @@ async function getChildren(
|
||||
_count: true,
|
||||
})
|
||||
: Promise.resolve([]),
|
||||
safeItemCounts(ids),
|
||||
getCatalogItemCounts(ids),
|
||||
]);
|
||||
const childMap = Object.fromEntries(
|
||||
childCounts.map((c) => [toInt(c.parentId), c._count]),
|
||||
@@ -234,7 +234,7 @@ async function searchPages(q: string, isBc: boolean): Promise<TreeNode[]> {
|
||||
_count: true,
|
||||
})
|
||||
: Promise.resolve([]),
|
||||
safeItemCounts(ids),
|
||||
getCatalogItemCounts(ids),
|
||||
]);
|
||||
const childMap = Object.fromEntries(
|
||||
childCounts.map((c) => [toInt(c.parentId), c._count]),
|
||||
|
||||
Reference in new issue
Block a user