|
|
@ -176,7 +176,6 @@ export class LendingStationAPI extends DataSource {
|
|
|
|
.where('timeframe."cargoBikeId" = :id', { id: timeFrame.cargoBikeId })
|
|
|
|
.where('timeframe."cargoBikeId" = :id', { id: timeFrame.cargoBikeId })
|
|
|
|
.andWhere('timeframe."dateRange" && :tr', { tr: timeFrame.dateRange })
|
|
|
|
.andWhere('timeframe."dateRange" && :tr', { tr: timeFrame.dateRange })
|
|
|
|
.getMany();
|
|
|
|
.getMany();
|
|
|
|
console.log(overlapping);
|
|
|
|
|
|
|
|
if (overlapping.length !== 0) {
|
|
|
|
if (overlapping.length !== 0) {
|
|
|
|
throw new UserInputError('TimeFrames with ids: ' + overlapping.map((e) => { return e.id + ', '; }) + 'are overlapping');
|
|
|
|
throw new UserInputError('TimeFrames with ids: ' + overlapping.map((e) => { return e.id + ', '; }) + 'are overlapping');
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -198,7 +197,6 @@ export class LendingStationAPI extends DataSource {
|
|
|
|
.set(timeFrame.lendingStationId);
|
|
|
|
.set(timeFrame.lendingStationId);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
if (e instanceof UserInputError) {
|
|
|
|
if (e instanceof UserInputError) {
|
|
|
|
return e;
|
|
|
|
return e;
|
|
|
|
} else if (e instanceof QueryFailedError) {
|
|
|
|
} else if (e instanceof QueryFailedError) {
|
|
|
|