add service
All checks were successful
Deploy Smart Search Backend Test / deploy (push) Successful in 1m40s
All checks were successful
Deploy Smart Search Backend Test / deploy (push) Successful in 1m40s
This commit is contained in:
@@ -2,6 +2,7 @@ package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"git.techease.ru/Smart-search/smart-search-back/pkg/errors"
|
||||
@@ -33,14 +34,26 @@ func (h *RequestHandler) ApproveTZ(ctx context.Context, req *pb.ApproveTZRequest
|
||||
return nil, errors.ToGRPCError(err, h.logger, "RequestService.ApproveTZ")
|
||||
}
|
||||
|
||||
_, err = h.requestService.ApproveTZ(ctx, requestID, req.FinalTz, int(req.UserId))
|
||||
suppliers, err := h.requestService.ApproveTZ(ctx, requestID, req.FinalTz, int(req.UserId))
|
||||
if err != nil {
|
||||
return nil, errors.ToGRPCError(err, h.logger, "RequestService.ApproveTZ")
|
||||
}
|
||||
|
||||
pbSuppliers := make([]*pb.Supplier, 0, len(suppliers))
|
||||
for _, s := range suppliers {
|
||||
pbSuppliers = append(pbSuppliers, &pb.Supplier{
|
||||
Id: strconv.Itoa(s.ID),
|
||||
Name: s.Name,
|
||||
Email: s.Email,
|
||||
Phone: s.Phone,
|
||||
Address: s.Address,
|
||||
Url: s.URL,
|
||||
})
|
||||
}
|
||||
|
||||
return &pb.ApproveTZResponse{
|
||||
Success: true,
|
||||
MailingStatus: "sent",
|
||||
RequestId: req.RequestId,
|
||||
Suppliers: pbSuppliers,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user