refactor: changed the getUserProjects to get projects in a specific workspace

This commit is contained in:
2026-07-06 13:24:36 +03:30
parent 2590a222b4
commit 5715cbe9b1
4 changed files with 16 additions and 9 deletions
@@ -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 };
}