fix: some api bug
This commit is contained in:
@@ -32,23 +32,21 @@ func NewGetMyVerificationsLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
||||
}
|
||||
|
||||
func (l *GetMyVerificationsLogic) GetMyVerifications() (resp *types.GetMyVerificationsResp, err error) {
|
||||
// todo: add your logic here and delete this line
|
||||
userId, err := contextj.UserIDFrom(l.ctx)
|
||||
if err != nil {
|
||||
logx.Errorf("get user id from context: %v", err)
|
||||
return nil, contextj.ERRILLEGALUSER
|
||||
}
|
||||
|
||||
verifications, err := l.svcCtx.UserVerificationsRpc.SearchUserVerifications(l.ctx, &pb.SearchUserVerificationsReq{
|
||||
verifications, err := l.svcCtx.UserVerificationsRpc.ListUserVerificationsByUserId(l.ctx, &pb.ListUserVerificationsByUserIdReq{
|
||||
UserId: userId,
|
||||
Page: 1,
|
||||
Limit: 100, // assuming a user won't have more than 100 verification records, adjust as needed
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var searchResults []types.VerificationItem
|
||||
|
||||
for _, v := range verifications.UserVerifications {
|
||||
temp := types.VerificationItem{}
|
||||
err = copier.Copy(&temp, v)
|
||||
|
||||
Reference in New Issue
Block a user