William Stanley
10/17/2021, 3:23 AMUser -in-> Organization -has_many-> Skus
At the moment I am doing:
let inventory = await prisma.user
.findUnique({ where: { id } })
.organization()
.skus({
where: {
product: {
...(name && { name: { contains: name, mode: "insensitive" } }),
},
},
select: {
id: true,
organization: true,
condition: true,
language: true,
binLocation: true,
inventoryEntries: true,
product: {
select: { uuid: true, identifiers: true, name: true },
},
},
});
is there a way to do it from: prisma.sku.findMany() or am I needlessly worried?Ryan
10/18/2021, 5:36 AM