diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2021-04-06 23:24:11 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-04-08 15:33:06 +0300 |
commit | 79ecd77d59d3d5f07142305483338836501dc57b (patch) | |
tree | c60eb250729dd6fd13cad03384fe5b856fc128a2 /lib/Service | |
parent | ed2e94b4589c3e9100a537c2f6001e354277fca9 (diff) |
Cleanup internal alias api
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/AliasesService.php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Service/AliasesService.php b/lib/Service/AliasesService.php index 933303187..869d59708 100644 --- a/lib/Service/AliasesService.php +++ b/lib/Service/AliasesService.php @@ -26,7 +26,6 @@ namespace OCA\Mail\Service; use OCA\Mail\Db\Alias; use OCA\Mail\Db\AliasMapper; use OCA\Mail\Db\MailAccountMapper; -use OCA\Mail\Exception\ClientException; use OCP\AppFramework\Db\DoesNotExistException; class AliasesService { @@ -61,20 +60,16 @@ class AliasesService { } /** - * @param string $currentUserId + * @param string $userId * @param int $accountId * @param string $alias * @param string $aliasName * * @return Alias - * @throws ClientException + * @throws DoesNotExistException */ - public function create(string $currentUserId, int $accountId, string $alias, string $aliasName): Alias { - try { - $this->mailAccountMapper->find($currentUserId, $accountId); - } catch (DoesNotExistException $e) { - throw new ClientException("Account $accountId does not exist or no permission to access it"); - } + public function create(string $userId, int $accountId, string $alias, string $aliasName): Alias { + $this->mailAccountMapper->find($userId, $accountId); $aliasEntity = new Alias(); $aliasEntity->setAccountId($accountId); |