fix err
This commit is contained in:
@@ -132,7 +132,7 @@ func (s SilvermobiGRPCService) GetAccountType(ctx context.Context, req *grpcprot
|
||||
log.Info().
|
||||
Str("User ID", id).
|
||||
Msg("GetAccountType")
|
||||
if req.Request == false || !req.Request {
|
||||
if req.Request == nil || !*req.Request {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "request arg should be true")
|
||||
}
|
||||
account_type, err := s.Handler.GetAccountType(ctx, id)
|
||||
@@ -150,7 +150,7 @@ func (s SilvermobiGRPCService) GetAccountType(ctx context.Context, req *grpcprot
|
||||
}
|
||||
|
||||
response := &grpcproto.AccountTypeResponse{
|
||||
Type: responseType,
|
||||
Type: &responseType,
|
||||
}
|
||||
|
||||
return response, nil
|
||||
|
||||
@@ -23,11 +23,11 @@ func (s *SolidarityService) SetDriverPunctualAvailabilities(ctx context.Context,
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.CreateBookingSilvermobiRequest) (resp *proto.CreateBookingSilvermobiResponse, err error) {
|
||||
func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.CreateBookingRequest) (resp *proto.CreateBookingResponse, err error) {
|
||||
log.Info().
|
||||
Str("Booking ID", req.Booking.Id).
|
||||
Msg("CreateBooking")
|
||||
resp, err = s.SolidarityClient.CreateBookingSilvermobi(ctx, req)
|
||||
resp, err = s.SolidarityClient.CreateBooking(ctx, req)
|
||||
if err == nil {
|
||||
_ = s.Handler.SendNotification(req.Booking.DriverId, "Silvermobi", "Vous avez reçu une demande de trajet. \n Pour plus de détails, veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi.")
|
||||
err = s.Handler.SendEmail(req.Booking.DriverId, "Silvermobi", "Vous avez reçu une demande de trajet. \n Pour plus de détails, veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi.")
|
||||
@@ -36,19 +36,19 @@ func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.Create
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (s *SolidarityService) UpdateBooking(ctx context.Context, req *proto.UpdateBookingSilvermobiRequest) (resp *proto.UpdateBookingSilvermobiResponse, err error) {
|
||||
func (s *SolidarityService) UpdateBooking(ctx context.Context, req *proto.UpdateBookingRequest) (resp *proto.UpdateBookingResponse, err error) {
|
||||
log.Info().
|
||||
Str("Booking ID", req.BookingId).
|
||||
Msg("UpdateBooking")
|
||||
resp, err = s.SolidarityClient.UpdateBookingSilvermobi(ctx, req)
|
||||
resp, err = s.SolidarityClient.UpdateBooking(ctx, req)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (s *SolidarityService) GetBooking(ctx context.Context, req *proto.GetBookingSilvermobiRequest) (resp *proto.GetBookingSilvermobiResponse, err error) {
|
||||
func (s *SolidarityService) GetBooking(ctx context.Context, req *proto.GetBookingRequest) (resp *proto.GetBookingResponse, err error) {
|
||||
log.Info().
|
||||
Str("Booking ID", req.BookingId).
|
||||
Msg("GetBooking")
|
||||
resp, err = s.SolidarityClient.GetBookingSilvermobi(ctx, req)
|
||||
resp, err = s.SolidarityClient.GetBooking(ctx, req)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user