Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/public/public.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export class PublicController {
},
})
@HttpCode(HttpStatus.OK)
/*
* Retrieves public information about the application including app name, version, and available features.
* @returns {Promise<Object>} Returns an object containing a success message and application data
* including appName, version, description, and list of features.
* @throws {UnauthorizedException} If the user is not authenticated or lacks admin role.
*/
getPublicInfo() {
return {
message: 'This is public information - no authentication required',
Expand All @@ -58,6 +64,12 @@ export class PublicController {

@Get('courses')
@HttpCode(HttpStatus.OK)
/*
* Retrieves a list of publicly available courses from the platform.
* @returns {Promise<Object>} Returns an object containing a success message and an array of courses,
* each with id, title, description, category, and publication status.
* @throws {UnauthorizedException} If the user is not authenticated or lacks admin role.
*/
getPublicCourses() {
return {
message: 'Public course catalog - no authentication required',
Expand All @@ -84,6 +96,12 @@ export class PublicController {

@Get('categories')
@HttpCode(HttpStatus.OK)
/*
* Retrieves a list of all available course categories with their styling information.
* @returns {Promise<Object>} Returns an object containing a success message and an array of categories,
* each with id, name, and associated color code.
* @throws {UnauthorizedException} If the user is not authenticated or lacks admin role.
*/
getPublicCategories() {
return {
message: 'Public course categories - no authentication required',
Expand Down