refactor: changed the getUserProjects to get projects in a specific workspace
This commit is contained in:
@@ -124,12 +124,12 @@ export class ProjectService {
|
||||
return project;
|
||||
}
|
||||
|
||||
async findUserProjects(userId: string, pagination: PaginationDto): Promise<{ projects: TMProject[]; count: number; paginate: true }> {
|
||||
async findUserProjects(userId: string, wsId: string, pagination: PaginationDto): Promise<{ projects: TMProject[]; count: number; paginate: true }> {
|
||||
const page = pagination.page ?? 1;
|
||||
const limit = pagination.limit ?? 10;
|
||||
const skip = (page - 1) * limit;
|
||||
|
||||
const [projects, count] = await this.projectRepository.findUserProjects(userId, skip, limit);
|
||||
const [projects, count] = await this.projectRepository.findUserProjects(userId, wsId, skip, limit);
|
||||
|
||||
return { projects, count, paginate: true };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user