RezinaLMS-BackEnd/internal/services/examprep/public_catalog.go

21 lines
566 B
Go

package examprep
import (
"Rezina-Backend/internal/domain"
"context"
"errors"
"github.com/jackc/pgx/v5"
)
func (s *Service) PublicCatalogCourses(ctx context.Context, search string, limit, offset int32) (domain.PublicCatalogPage, error) {
return s.store.PublicCatalogCourses(ctx, search, limit, offset)
}
func (s *Service) PublicCatalogCourse(ctx context.Context, id int64) (domain.PublicCourseOutline, error) {
out, err := s.store.PublicCatalogCourse(ctx, id)
if errors.Is(err, pgx.ErrNoRows) {
return out, ErrCatalogCourseNotFound
}
return out, err
}