fix and conversions
This commit is contained in:
@@ -66,3 +66,24 @@ func (s *CarpoolServiceServerImpl) GetUserPlanning(ctx context.Context, req *pro
|
||||
RoutesByDates: results,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) GetPlannedTrip(ctx context.Context, req *proto.GetPlannedTripRequest) (*proto.GetPlannedTripResponse, error) {
|
||||
planned_trip, err := s.Handler.GetPlannedTrip(req.Id)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not retrieve planned trip - %s", err.Error())
|
||||
}
|
||||
|
||||
planned_trip.Route.ExtraMembers["departure_date"] = planned_trip.DepartureDate
|
||||
|
||||
serialized, err := planned_trip.Route.FeatureCollection().MarshalJSON()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("grpc GetPlannedTrip - could not serialize feature collection")
|
||||
return nil, status.Errorf(codes.Internal, "could not serialize feature collection")
|
||||
}
|
||||
|
||||
return &proto.GetPlannedTripResponse{
|
||||
PlannedTrip: &proto.CarpoolFeatureCollection{
|
||||
Serialized: string(serialized),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user