v0.18.1 patch — Pantry: location dropdown shows Kitchen only

Filter locations to Kitchen and its children (fridge, freezer, pantry
shelves, etc.). Display the full path so "Kitchen › Freezer" shows
instead of just "Freezer".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bonna Moon
2026-06-29 17:49:37 -05:00
parent e501679416
commit c449b0c2ae
3 changed files with 13 additions and 3 deletions

View File

@@ -17,7 +17,17 @@ export default async function PantryPage() {
plant: { select: { id: true, commonName: true, variety: true } },
},
}),
db.location.findMany({ where: { active: true }, orderBy: { name: "asc" }, select: { id: true, name: true } }),
db.location.findMany({
where: {
active: true,
OR: [
{ name: { equals: "Kitchen", mode: "insensitive" } },
{ path: { contains: "Kitchen", mode: "insensitive" } },
],
},
orderBy: { path: "asc" },
select: { id: true, name: true, path: true },
}),
db.plant.findMany({ where: { active: true }, orderBy: { commonName: "asc" }, select: { id: true, commonName: true, variety: true } }),
]);