Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/presentation/controllers/modules.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export class ModulesController {
throw new UnauthorizedException('Study credits must be 15 or 30');
}

if (moduleData.level !== 'NFQL5' && moduleData.level !== 'NFQL6') {
throw new UnauthorizedException('Level must be NFQL5 or NFQL6');
if (moduleData.level !== 'NLQF5' && moduleData.level !== 'NLQF6') {
throw new UnauthorizedException('Level must be NLQF5 or NLQF6');
}

const module = await this.moduleService.createModule(moduleData);
Expand Down
8 changes: 5 additions & 3 deletions src/presentation/dtos/choiceModule.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { LocationDTO } from './location.dto';
import { ModuleTagDTO } from './moduleTag.dto';
import { Type } from 'class-transformer';
import {
IsString,
IsNumber,
Expand All @@ -7,7 +10,6 @@ import {
MinLength,
Min,
IsDateString,
IsObject,
} from 'class-validator';

export class CreateModuleDTO {
Expand Down Expand Up @@ -40,12 +42,12 @@ export class CreateModuleDTO {

@ApiProperty()
@IsArray()
@IsObject({ each: true })
@Type(() => LocationDTO)
location: { id: string; name: string }[];

@ApiProperty()
@IsArray()
@IsObject({ each: true })
@Type(() => ModuleTagDTO)
moduleTags: { id: string; name: string }[];

@ApiProperty()
Expand Down
22 changes: 22 additions & 0 deletions src/presentation/dtos/location.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsString,
IsNumber,
IsArray,
IsNotEmpty,
MinLength,
Min,
IsDateString,
} from 'class-validator';

export class LocationDTO {
@ApiProperty()
@IsString()
@IsNotEmpty()
id: string;
@ApiProperty()
@IsString()
@IsNotEmpty()
name: string;
}
22 changes: 22 additions & 0 deletions src/presentation/dtos/moduleTag.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsString,
IsNumber,
IsArray,
IsNotEmpty,
MinLength,
Min,
IsDateString,
} from 'class-validator';
export class ModuleTagDTO {
@ApiProperty()
@IsString()
@IsNotEmpty()
id: string;

@ApiProperty()
@IsString()
@IsNotEmpty()
name: string;
}