roobr
roobr
Explore posts from servers
PPrisma
Created by roobr on 5/27/2024 in #help-and-questions
Nuxt 3 - Prisma building production
Hi Guys, it seems like I am havcing issues with my Prisma sections of my system working once i build and run my application. Just wondering if there is another step I am missing as it works fine when doing it on my dev server using pnpm run dev. Thanks in advance
22 replies
PPrisma
Created by roobr on 5/6/2024 in #help-and-questions
orderBy on a relation include
Hello, I am hoping for some assistance with the best way to handle my query and see what is possible.
const items = await prisma.items.findMany({
include: {
item_categories_item_categories_item_idTocategories: {
include: {
categories_item_categories_category_idTocategories: {
select: {
id: true,
name: true,
},
orderBy: {
list_order: 'asc',
},
},
},
},
item_subcategory_item_subcategory_item_idTosubcategories: {
include: {
subcategories_item_subcategory_subcat_idTosubcategories: {
select: {
id: true,
name: true,
main_category: true,
},
},
},
},
},
const items = await prisma.items.findMany({
include: {
item_categories_item_categories_item_idTocategories: {
include: {
categories_item_categories_category_idTocategories: {
select: {
id: true,
name: true,
},
orderBy: {
list_order: 'asc',
},
},
},
},
item_subcategory_item_subcategory_item_idTosubcategories: {
include: {
subcategories_item_subcategory_subcat_idTosubcategories: {
select: {
id: true,
name: true,
main_category: true,
},
},
},
},
},
4 replies