import express from 'express';
import { wrapAsync } from '@/api/http/request';
import * as public_content_catalog from '@/api/controllers/public_content_catalog.controller';

const router = express.Router();

/**
 * @openapi
 * /api/public/content-catalog/{contentType}:
 *   get:
 *     tags: [Public]
 *     summary: Get published content for a content type (public-by-design)
 *     description: Unauthenticated; serves only published, non-tenant content.
 *     security: []
 *     parameters:
 *       - in: path
 *         name: contentType
 *         required: true
 *         schema: { type: string }
 *     responses:
 *       200: { description: Published content for the type. }
 */
router.get('/:contentType', wrapAsync(public_content_catalog.findByType));

export default router;
