Custom fields of db.query for many to many relationship for FE

Is it possible to just use "sizes" and "colors". Not sizes.size and colors.color? so that I dont have to change my Frontend
const product = await db.query.Product.findFirst({
where : eq(Product.id, productId),

with: {
category: true, // This already includes the category with its details
colors: {
with : {
color:true
}
},
sizes: {
with : {
size: {
with: {
dimensions: true
}
}
}
}
},
});
const product = await db.query.Product.findFirst({
where : eq(Product.id, productId),

with: {
category: true, // This already includes the category with its details
colors: {
with : {
color:true
}
},
sizes: {
with : {
size: {
with: {
dimensions: true
}
}
}
}
},
});
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server