Returning StorageLocations in storageUnit api.

This commit is contained in:
Leon Meier 2023-05-16 21:15:17 +02:00
parent 533bc1744d
commit 90fc8068a0

View File

@ -15,9 +15,10 @@ function get(req: Request, res: Response) {
where: { where: {
id: parseInt(req.query.id.toString()) id: parseInt(req.query.id.toString())
}, },
// Get category name from relation. // Get contactInfo and StorageLocation from relation.
include: { include: {
contactInfo: true contactInfo: true,
StorageLocation: true
} }
}) })
.then((items) => { .then((items) => {
@ -34,9 +35,10 @@ function get(req: Request, res: Response) {
} else { } else {
prisma.storageUnit prisma.storageUnit
.findMany({ .findMany({
// Get category name from relation. // Get contactInfo and StorageLocation from relation.
include: { include: {
contactInfo: true contactInfo: true,
StorageLocation: true
} }
}) })
.then((items) => { .then((items) => {