diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e86c4ee..2e3b387 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,16 +4,10 @@
-
+
-
-
-
-
+
-
-
-
@@ -113,8 +107,8 @@
-
+
@@ -135,7 +129,7 @@
1774643312599
-
+
@@ -345,14 +339,32 @@
1774718397058
-
+
+
+ 1774718807082
+
+
+
+ 1774718807082
+
+
+
+
+
-
@@ -377,6 +389,7 @@
-
+
+
\ No newline at end of file
diff --git a/apps/api/src/reports/reports.service.ts b/apps/api/src/reports/reports.service.ts
index f096468..9d9ea2c 100644
--- a/apps/api/src/reports/reports.service.ts
+++ b/apps/api/src/reports/reports.service.ts
@@ -132,8 +132,8 @@ export class ReportsService {
const data = reservations.map(r => ({
'Reservation ID': r.id,
- 'User Email': r.user.email,
- 'User Role': r.user.role,
+ 'User Email': r.user?.email || 'N/A',
+ 'User Role': r.user?.role || 'N/A',
'Building': r.space.floor.building.name,
'Floor': r.space.floor.number,
'Space Name': r.space.name,
diff --git a/apps/api/src/reservations/reservations.service.ts b/apps/api/src/reservations/reservations.service.ts
index 9e0e047..787760c 100644
--- a/apps/api/src/reservations/reservations.service.ts
+++ b/apps/api/src/reservations/reservations.service.ts
@@ -3,7 +3,7 @@ import { PrismaService } from '../prisma/prisma.service';
import { EventsGateway } from '../events/events.gateway';
import { CreateReservationDto } from './dto/create-reservation.dto';
import { UpdateReservationDto } from './dto/update-reservation.dto';
-import { SpaceType } from '@prisma/client';
+import { SpaceType, Role } from '@prisma/client';
@Injectable()
export class ReservationsService {
@@ -94,7 +94,7 @@ export class ReservationsService {
}
}
}
- });
+ }) as any;
// Notify clients on the floor
this.eventsGateway.emitSpaceStatusChanged(space.floorId, spaceId, true, {
@@ -197,8 +197,8 @@ export class ReservationsService {
const spaceId = updateReservationDto.spaceId || reservation.spaceId;
const startTime = updateReservationDto.startTime || reservation.startTime;
const endTime = updateReservationDto.endTime || reservation.endTime;
- const targetUserId = updateReservationDto.userId === null ? null : (updateReservationDto.userId || reservation.userId);
- const note = updateReservationDto.note === undefined ? reservation.note : updateReservationDto.note;
+ const targetUserId = updateReservationDto.userId === null ? undefined : (updateReservationDto.userId || reservation.userId);
+ const note = updateReservationDto.note === undefined ? (reservation as any).note : updateReservationDto.note;
const space = await this.prisma.space.findUnique({
where: { id: spaceId },
@@ -279,7 +279,7 @@ export class ReservationsService {
},
space: true
}
- });
+ }) as any;
// Notify clients on the floor if space or time changed
if (reservation.spaceId !== updated.spaceId) {