Add new error for project transfer

This commit is contained in:
Matej Bačo
2022-12-30 00:04:39 +01:00
parent 3261777fcd
commit 73e9668a9c
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -678,6 +678,10 @@ App::patch('/v1/projects/:projectId/team')
throw new Exception(Exception::TEAM_NOT_FOUND);
}
if ($team->getInternalId() === $project->getAttribute('teamInternalId')) {
throw new Exception(Exception::PROJECT_TEAM_ALREADY_MATCHES);
}
$project
->setAttribute('teamId', $team->getId())
->setAttribute('teamInternalId', $team->getInternalId())