This commit is contained in:
@@ -23,22 +23,15 @@ func (h *InviteHandler) Generate(ctx context.Context, req *pb.GenerateRequest) (
|
||||
}
|
||||
|
||||
func (h *InviteHandler) GetInfo(ctx context.Context, req *pb.GetInfoRequest) (*pb.GetInfoResponse, error) {
|
||||
code, err := strconv.ParseInt(req.Code, 10, 64)
|
||||
if err != nil {
|
||||
return nil, errors.ToGRPCError(err, h.logger, "InviteService.GetInfo")
|
||||
}
|
||||
|
||||
invite, err := h.inviteService.GetInfo(ctx, code)
|
||||
invite, err := h.inviteService.GetInfo(ctx, int(req.UserId))
|
||||
if err != nil {
|
||||
return nil, errors.ToGRPCError(err, h.logger, "InviteService.GetInfo")
|
||||
}
|
||||
|
||||
return &pb.GetInfoResponse{
|
||||
Code: strconv.FormatInt(invite.Code, 10),
|
||||
UserId: int64(invite.UserID),
|
||||
CanBeUsedCount: int32(invite.CanBeUsedCount),
|
||||
ExpiresAt: timestamppb.New(invite.ExpiresAt),
|
||||
IsActive: invite.IsActive,
|
||||
CreatedAt: timestamppb.New(invite.CreatedAt),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user