refactor: changed the getUserProjects to get projects in a specific workspace
This commit is contained in:
@@ -10,6 +10,7 @@ import { PermissionsDec } from "../../../common/decorators/permission.decorator"
|
||||
import { PermissionEnum } from "../../users/enums/permission.enum";
|
||||
import { UserDec } from "../../../common/decorators/user.decorator";
|
||||
import { AuthGuards } from "../../../common/decorators/auth-guard.decorator";
|
||||
import { ParamDto } from "../../../common/DTO/param.dto";
|
||||
|
||||
@AuthGuards()
|
||||
@AdminRoute()
|
||||
@@ -67,13 +68,15 @@ export class ProjectController {
|
||||
return this.projectService.remove(id);
|
||||
}
|
||||
|
||||
@Get("/user")
|
||||
@Get("/user/workspace/:id")
|
||||
@ApiOperation({ summary: "Get user projects!" })
|
||||
@ApiResponse({ status: 200, description: "Got user projects successfully!" })
|
||||
@ApiResponse({status: 400, description: "Bad Request!"})
|
||||
findUserProjects(
|
||||
@UserDec("id") userId: string,
|
||||
@Param() paramDto : ParamDto,
|
||||
@Query() pagination: PaginationDto,
|
||||
): Promise<{ projects: TMProject[]; count: number; paginate: true }> {
|
||||
return this.projectService.findUserProjects(userId, pagination);
|
||||
return this.projectService.findUserProjects(userId, paramDto.id, pagination);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user