1
0
Fork 0
mirror of synced 2024-06-30 04:00:34 +12:00

review fixes

This commit is contained in:
prateek banga 2023-11-15 12:52:27 +05:30
parent db9a946b0c
commit 2aa8391c5e
2 changed files with 2 additions and 14 deletions

View file

@ -2063,11 +2063,7 @@ App::patch('/v1/account/email')
$oldTarget = $user->find('identifier', $oldEmail, 'targets');
if ($oldTarget !== false && !$oldTarget->isEmpty()) {
try {
$dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $email));
} catch (Duplicate) {
throw new Exception(Exception::USER_TARGET_ALREADY_EXISTS);
}
$dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $email));
}
try {
@ -2143,11 +2139,7 @@ App::patch('/v1/account/phone')
}
if ($oldTarget !== false && !$oldTarget->isEmpty()) {
try {
$dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $phone));
} catch (Duplicate) {
throw new Exception(Exception::USER_TARGET_ALREADY_EXISTS);
}
$dbForProject->updateDocument('targets', $oldTarget->getId(), $oldTarget->setAttribute('identifier', $phone));
}
try {

View file

@ -814,10 +814,6 @@ App::patch('/v1/messaging/providers/mailgun/:providerId')
if ($provider->getAttribute('internal') === true && $enabled === false) {
throw new Exception(Exception::PROVIDER_INTERNAL_UPDATE_DISABLED);
}
if ($provider->getAttribute('internal') === true && $enabled === false) {
throw new Exception(Exception::PROVIDER_INTERNAL_UPDATE_DISABLED);
}
$provider->setAttribute('enabled', $enabled);
}