mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 14:15:44 +00:00
Production checklists, issue fixes
This commit is contained in:
@@ -33,8 +33,11 @@ export class StationsService {
|
||||
where.countryCode = filters.country;
|
||||
}
|
||||
|
||||
// Default to operational stations only; allow explicit override (e.g. back-office)
|
||||
if (filters.operational !== undefined && filters.operational !== '') {
|
||||
where.isOperational = filters.operational === 'true';
|
||||
} else {
|
||||
where.isOperational = true;
|
||||
}
|
||||
|
||||
return this.prisma.station.findMany({
|
||||
@@ -46,6 +49,7 @@ export class StationsService {
|
||||
async findOne(id: string) {
|
||||
const s = await this.prisma.station.findUnique({ where: { id } });
|
||||
if (!s) throw new NotFoundException('Station not found');
|
||||
if (!s.isOperational) throw new NotFoundException('Station is not operational');
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user