diff --git a/src/controllers/room_services.ts b/src/controllers/room_services.ts index dd2b835..5b50311 100644 --- a/src/controllers/room_services.ts +++ b/src/controllers/room_services.ts @@ -83,22 +83,22 @@ export class RoomServicesController { status: room.status, department: room.department ? { - id: room.department.id, - name: room.department.name, - } + id: room.department.id, + name: room.department.name, + } : null, service_types, services: room.services ? room.services.map((service) => ({ - id: service.id, - name: service.name, - service_type: service.serviceType - ? { - id: service.serviceType.id, - name: service.serviceType.name, - } - : null, - })) + id: service.id, + name: service.name, + service_type: service.serviceType + ? { + id: service.serviceType.id, + name: service.serviceType.name, + } + : null, + })) : [], }; }); @@ -177,7 +177,6 @@ export class RoomServicesController { "fareType.id", "fareType.name", ]) - .leftJoin("Service.serviceType", "serviceType") .leftJoin("Service.rooms", "room") .leftJoin("room.serviceclass", "roomClass") .innerJoin("Service.servicefare", "serviceFare")