1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

linting and wording updates based on stnguyen90 feedback

This commit is contained in:
jaivix 2023-07-13 00:33:38 +05:30
parent a6671a5caa
commit 4db919b42d
3 changed files with 6 additions and 6 deletions

View file

@ -227,9 +227,9 @@ return [
'description' => 'The invite does not belong to the current user.',
'code' => 401,
],
Exception::TEAM_ID_CONFLICT => [
'name' => Exception::TEAM_ID_CONFLICT,
'description' => 'Team ID already existed.',
Exception::TEAM_ALREADY_EXISTS => [
'name' => Exception::TEAM_ALREADY_EXISTS,
'description' => 'Team with requested ID already exists.',
'code' => 409,
],

View file

@ -67,7 +67,7 @@ App::post('/v1/teams')
$isAppUser = Auth::isAppUser(Authorization::getRoles());
$teamId = $teamId == 'unique()' ? ID::unique() : $teamId;
try {
$team = Authorization::skip(fn() => $dbForProject->createDocument('teams', new Document([
'$id' => $teamId,
@ -82,7 +82,7 @@ App::post('/v1/teams')
'search' => implode(' ', [$teamId, $name]),
])));
} catch (Duplicate $th) {
throw new Exception(Exception::TEAM_ID_CONFLICT);
throw new Exception(Exception::TEAM_ALREADY_EXISTS);
}
if (!$isPrivilegedUser && !$isAppUser) { // Don't add user on server mode

View file

@ -83,7 +83,7 @@ class Exception extends \Exception
public const TEAM_INVALID_SECRET = 'team_invalid_secret';
public const TEAM_MEMBERSHIP_MISMATCH = 'team_membership_mismatch';
public const TEAM_INVITE_MISMATCH = 'team_invite_mismatch';
public const TEAM_ID_CONFLICT = 'team_id_conflict';
public const TEAM_ALREADY_EXISTS = 'team_already_exists';
/** Membership */
public const MEMBERSHIP_NOT_FOUND = 'membership_not_found';