Skip to content

Commit

Permalink
Merge pull request #56 from SAIG-KMITL/feat/connect-with-roadmap-ai
Browse files Browse the repository at this point in the history
fix: remove user occupation public guards
  • Loading branch information
khris-xp authored Nov 29, 2024
2 parents f0a7d82 + 04d2c85 commit 91173c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/enrollment/enrollment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ export class EnrollmentService {
const enrollments = await find({
relations: {
user: true,
course: true,
course: {
teacher: true,
category: true,
},
},
}).run();

return enrollments;
}

Expand Down
7 changes: 4 additions & 3 deletions src/roadmap/roadmap.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Course } from 'src/course/course.entity';
import { GLOBAL_CONFIG } from 'src/shared/constants/global-config.constant';
import { CourseStatus } from 'src/shared/enums';
import { createPagination } from 'src/shared/pagination';
import { UserBackgroundService } from 'src/user-background/user-background.service';
Expand Down Expand Up @@ -132,7 +131,8 @@ export class RoadmapService {
.leftJoinAndSelect('roadmap.user', 'user')
.leftJoinAndSelect('roadmap.courses', 'courses')
.leftJoinAndSelect('courses.teacher', 'teacher')
.leftJoinAndSelect('courses.category', 'category');
.leftJoinAndSelect('courses.category', 'category')
.orderBy('roadmap.priority', 'ASC');

if (userId) {
queryBuilder.andWhere('user.id = :userId', { userId });
Expand All @@ -152,6 +152,7 @@ export class RoadmapService {

return new PaginatedRoadmapResponseDto(data, total, limit, page);
}

async findOne(options: FindOneOptions<Roadmap>): Promise<Roadmap> {
try {
const roadmap = await this.roadmapRepository.findOne(options);
Expand Down Expand Up @@ -192,4 +193,4 @@ export class RoadmapService {
throw new InternalServerErrorException(error.message);
}
}
}
}
1 change: 0 additions & 1 deletion src/user-occupation/user-occupation.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class UserOccupationController {

@Post()
@Roles(Role.ADMIN)
@Public()
@ApiResponse({
status: HttpStatus.CREATED,
type: UserOccupationResponseDto,
Expand Down

0 comments on commit 91173c4

Please sign in to comment.