uid = $UserId; $this->trustedSenderService = $trustedSenderService; } /** * @NoAdminRequired * * @param string $email * @param string $type * @return JsonResponse */ #[TrapError] public function setTrusted(string $email, string $type): JsonResponse { $this->trustedSenderService->trust( $this->uid, $email, $type ); return JsonResponse::success(null, Http::STATUS_CREATED); } /** * @NoAdminRequired * * @param string $email * @param string $type * @return JsonResponse */ #[TrapError] public function removeTrust(string $email, string $type): JsonResponse { $this->trustedSenderService->trust( $this->uid, $email, $type, false ); return JsonResponse::success(null); } /** * @NoAdminRequired * * @return JsonResponse */ #[TrapError] public function list(): JsonResponse { $list = $this->trustedSenderService->getTrusted( $this->uid ); return JsonResponse::success($list); } }