// LoadProducts - getting csv-file by from external source(url) and save products
getting csv-file by from external source(url) and save products
// LoadProducts - getting csv - file by from external source ( url ) and save products
func (h *Handler) LoadProducts(ctx context.Context, req *pb.LoadProductsRequest) (*pb.LoadProductsResponse, error) {
	err := h.services.LoadProducts(ctx, h.fileSaveDir, req.GetUrl())
	if err != nil {
		logrus.Errorf("load products fail: %s", err.Error())
		return nil, fmt.Errorf("load products fail: %w", err)
	}
	return &pb.LoadProductsResponse{
		Code:    http.StatusOK,
		Message: "Products downloaded OK",
	}, nil
}
func ( h * Handler ) LoadProducts ( ctx context . Context , req * pb . LoadProductsRequest ) ( * pb . LoadProductsResponse , error ) { err := h . services . LoadProducts ( ctx , h . fileSaveDir , req . GetUrl ( ) ) if err != nil { logrus . Errorf ( " " , err . Error ( ) ) return nil , fmt . Errorf ( " " , err ) } return & pb . LoadProductsResponse { Code : http . StatusOK , Message : " " , } , nil }
getting csv-file by from external source(url) and save products
getting csv - file by from external source ( url ) and save products