fix: mengabaikan non-active project ketika assign member

This commit is contained in:
Muhammad Zhafran Ilham
2026-06-27 22:37:00 +07:00
parent 38972ef561
commit 61fbac14c6
3 changed files with 7 additions and 1 deletions
@@ -428,6 +428,9 @@ class ProjectRepository {
in: userIds.map((id) => parseInt(id)),
},
status: "active",
project: {
status: "active"
}
},
include: {
user: {
@@ -541,6 +541,9 @@ class ProjectService {
if (!project) {
return error(new NotFoundError("Project not found"));
}
if (project.status !== "active") {
return error(new ConflictError("Cannot assign member to a non-active project"));
}
const user = await projectRepository.findUserByIdAndActive(id_user);
if (!user) {