fix: wire catalog add buttons, fix Trans bold rendering, lint cleanup
- CatalogSearchOverlay: replace handleAddStub with real openAddToCollection/openAddToThread routing based on catalogSearchMode - ConfirmDialog + __root.tsx: swap t() for Trans component on deleteItemMessage, deleteCandidateMessage, pickWinnerMessage — fixes <bold> rendering as literal text - Biome format pass: fix 23 lint/format errors across scripts, services, tests - Planning: mark all UAT and verification gaps resolved for phases 07, 11, 16, 20, 21, 22, 24, 32, 34; close debug sessions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
import type { SQL } from "drizzle-orm";
|
||||
import { and, count, eq, ilike, or, sql } from "drizzle-orm";
|
||||
import { db as prodDb } from "../../db/index.ts";
|
||||
import { globalItems, globalItemTags, items, manufacturers, tags } from "../../db/schema.ts";
|
||||
import {
|
||||
globalItems,
|
||||
globalItemTags,
|
||||
items,
|
||||
manufacturers,
|
||||
tags,
|
||||
} from "../../db/schema.ts";
|
||||
|
||||
type Db = typeof prodDb;
|
||||
type TxDb = Parameters<Parameters<Db["transaction"]>[0]>[0];
|
||||
|
||||
async function resolveManufacturerId(db: Db | TxDb, slug: string): Promise<number> {
|
||||
async function resolveManufacturerId(
|
||||
db: Db | TxDb,
|
||||
slug: string,
|
||||
): Promise<number> {
|
||||
const [m] = await (db as Db)
|
||||
.select({ id: manufacturers.id })
|
||||
.from(manufacturers)
|
||||
@@ -26,7 +35,10 @@ export async function searchGlobalItems(
|
||||
const escaped = query.replace(/%/g, "\\%").replace(/_/g, "\\_");
|
||||
const pattern = `%${escaped}%`;
|
||||
conditions.push(
|
||||
or(ilike(manufacturers.name, pattern), ilike(globalItems.model, pattern))!,
|
||||
or(
|
||||
ilike(manufacturers.name, pattern),
|
||||
ilike(globalItems.model, pattern),
|
||||
)!,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -221,7 +233,10 @@ export async function bulkUpsertGlobalItems(
|
||||
const resultItems = [];
|
||||
|
||||
for (const data of itemsData) {
|
||||
const manufacturerId = await resolveManufacturerId(tx as unknown as Db, data.manufacturerSlug);
|
||||
const manufacturerId = await resolveManufacturerId(
|
||||
tx as unknown as Db,
|
||||
data.manufacturerSlug,
|
||||
);
|
||||
|
||||
const [existing] = await tx
|
||||
.select({ id: globalItems.id })
|
||||
|
||||
Reference in New Issue
Block a user