mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add new error for project transfer
This commit is contained in:
@@ -197,6 +197,11 @@ return [
|
||||
'description' => 'Team with the requested ID could not be found.',
|
||||
'code' => 404,
|
||||
],
|
||||
Exception::PROJECT_TEAM_ALREADY_MATCHES => [
|
||||
'name' => Exception::PROJECT_TEAM_ALREADY_MATCHES,
|
||||
'description' => 'Project already owned by this team.',
|
||||
'code' => 400,
|
||||
],
|
||||
Exception::TEAM_INVITE_ALREADY_EXISTS => [
|
||||
'name' => Exception::TEAM_INVITE_ALREADY_EXISTS,
|
||||
'description' => 'User has already been invited or is already a member of this team',
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -76,6 +76,7 @@ class Exception extends \Exception
|
||||
|
||||
/** Teams */
|
||||
public const TEAM_NOT_FOUND = 'team_not_found';
|
||||
public const PROJECT_TEAM_ALREADY_MATCHES = 'project_team_already_matches';
|
||||
public const TEAM_INVITE_ALREADY_EXISTS = 'team_invite_already_exists';
|
||||
public const TEAM_INVITE_NOT_FOUND = 'team_invite_not_found';
|
||||
public const TEAM_INVALID_SECRET = 'team_invalid_secret';
|
||||
|
||||
Reference in New Issue
Block a user