fix(admin): polish tickets, photos purge note, drizzle contracts
Add queue banners/counts on ticket detail pages, document local-only photo purge, and harden Drizzle Kit smoke contracts after Prisma removal. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
ba82789166
commit
3bd712e744
18 files changed
+148
-78
No files matched your search
@@ -138,7 +138,7 @@ export async function loadCatalogItemsData(
|
||||
): Promise<CatalogItemsData> {
|
||||
// Load items via raw query to work around pageId Int vs VARCHAR mismatch
|
||||
const pageIdStr = String(pageId);
|
||||
// CAST: live Habbo DBs often store page_id as VARCHAR while Prisma maps Int.
|
||||
// CAST: live Habbo DBs often store page_id as VARCHAR while schema maps Int.
|
||||
const [rawItems] = (await db.execute(sql`
|
||||
SELECT * FROM catalog_items
|
||||
WHERE CAST(page_id AS CHAR) = ${pageIdStr}
|
||||
|
||||
@@ -12,7 +12,7 @@ function toInt(value: unknown, fallback = 0): number {
|
||||
|
||||
/**
|
||||
* Count catalog_items per page via raw SQL.
|
||||
* Real Habbo DBs often store page_id as VARCHAR; Prisma Int groupBy fails or returns 0.
|
||||
* Real Habbo DBs often store page_id as VARCHAR; numeric groupBy fails or returns 0.
|
||||
*/
|
||||
export async function getCatalogItemCounts(
|
||||
pageIds?: number[],
|
||||
@@ -216,7 +216,7 @@ export async function movePage(
|
||||
|
||||
/**
|
||||
* Delete catalog_items for the given page ids.
|
||||
* Habbo DBs often store page_id as VARCHAR; Prisma Int deleteMany misses rows.
|
||||
* Habbo DBs often store page_id as VARCHAR; typed Int deletes can miss rows.
|
||||
*/
|
||||
async function deleteCatalogItemsByPageIds(pageIds: number[]): Promise<void> {
|
||||
if (pageIds.length === 0) return;
|
||||
|
||||
Reference in new issue
Block a user