Migrate away from item translations for Lists page

This commit is contained in:
Emi Matchu 2024-02-20 16:33:56 -08:00
parent 28ddc3455b
commit f196e2d8fe

View file

@ -1290,10 +1290,8 @@ const buildUserClosetHangersLoader = (db) =>
new DataLoader(async (userIds) => {
const qs = userIds.map((_) => "?").join(",");
const [rows] = await db.execute(
`SELECT closet_hangers.*, item_translations.name as item_name FROM closet_hangers
`SELECT closet_hangers.*, items.name as item_name FROM closet_hangers
INNER JOIN items ON items.id = closet_hangers.item_id
INNER JOIN item_translations ON
item_translations.item_id = items.id AND locale = "en"
WHERE user_id IN (${qs})
ORDER BY item_name`,
userIds,