From 90fc8068a046db2c19cf862c8202f4dcd63612e6 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Tue, 16 May 2023 21:15:17 +0200 Subject: [PATCH] Returning StorageLocations in storageUnit api. --- src/routes/api/v1/storageUnits.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/routes/api/v1/storageUnits.ts b/src/routes/api/v1/storageUnits.ts index 0c62c1a..054ad74 100644 --- a/src/routes/api/v1/storageUnits.ts +++ b/src/routes/api/v1/storageUnits.ts @@ -15,9 +15,10 @@ function get(req: Request, res: Response) { where: { id: parseInt(req.query.id.toString()) }, - // Get category name from relation. + // Get contactInfo and StorageLocation from relation. include: { - contactInfo: true + contactInfo: true, + StorageLocation: true } }) .then((items) => { @@ -34,9 +35,10 @@ function get(req: Request, res: Response) { } else { prisma.storageUnit .findMany({ - // Get category name from relation. + // Get contactInfo and StorageLocation from relation. include: { - contactInfo: true + contactInfo: true, + StorageLocation: true } }) .then((items) => {