bugfixes
This commit is contained in:
@@ -4,16 +4,16 @@ import { User, UserId } from './user';
|
||||
export type TravelId = number;
|
||||
|
||||
export class Travel extends TravelDto {
|
||||
constructor(travelDto: TravelDto) {
|
||||
super(travelDto.id,
|
||||
travelDto.driverInfo,
|
||||
travelDto.travelersInfo,
|
||||
travelDto.departureDate,
|
||||
travelDto.origin,
|
||||
travelDto.destination,
|
||||
travelDto.places,
|
||||
travelDto.matrixRoomId,
|
||||
travelDto.description);
|
||||
constructor(travelDto: TravelDto = null) {
|
||||
super(travelDto?.id,
|
||||
travelDto?.driverInfo,
|
||||
travelDto?.travelersInfo,
|
||||
travelDto?.departureDate,
|
||||
travelDto?.origin,
|
||||
travelDto?.destination,
|
||||
travelDto?.places,
|
||||
travelDto?.matrixRoomId,
|
||||
travelDto?.description);
|
||||
}
|
||||
|
||||
availablePlaces(): number {
|
||||
|
||||
@@ -28,7 +28,7 @@ export class EditTravelComponent implements OnInit {
|
||||
this.apiService.getTravel(travelId)
|
||||
.subscribe(res => {
|
||||
if (res.success) {
|
||||
this.travel = res.data;
|
||||
this.travel = new Travel(res.data);
|
||||
}
|
||||
else {
|
||||
console.error('Error getting travel ' + travelId + ': ' + res.error.code + ' ' + res.error.msg);
|
||||
|
||||
Reference in New Issue
Block a user