@@ -13,43 +13,43 @@ |
||
| 13 | 13 | class CreateAccountAction |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - public function __construct( |
|
| 16 | + public function __construct( |
|
| 17 | 17 | private EntityManagerInterface $manager, |
| 18 | 18 | private UserService $service, |
| 19 | 19 | private HydratorService $hydratorService |
| 20 | 20 | |
| 21 | - ) {} |
|
| 21 | + ) {} |
|
| 22 | 22 | |
| 23 | - public function __invoke(Request $request) |
|
| 24 | - { |
|
| 23 | + public function __invoke(Request $request) |
|
| 24 | + { |
|
| 25 | 25 | |
| 26 | 26 | try { |
| 27 | - $payload = json_decode($request->getContent()); |
|
| 28 | - $people = $this->service->discoveryPeople($payload->email, $payload->name); |
|
| 27 | + $payload = json_decode($request->getContent()); |
|
| 28 | + $people = $this->service->discoveryPeople($payload->email, $payload->name); |
|
| 29 | 29 | |
| 30 | - $user = $this->service->createUser( |
|
| 30 | + $user = $this->service->createUser( |
|
| 31 | 31 | $people, |
| 32 | 32 | $payload->email, |
| 33 | 33 | $payload->password |
| 34 | - ); |
|
| 34 | + ); |
|
| 35 | 35 | |
| 36 | - return new JsonResponse( |
|
| 36 | + return new JsonResponse( |
|
| 37 | 37 | $this->hydratorService->item( |
| 38 | - User::class, |
|
| 39 | - $user->getId(), |
|
| 40 | - "user:read" |
|
| 38 | + User::class, |
|
| 39 | + $user->getId(), |
|
| 40 | + "user:read" |
|
| 41 | 41 | ) |
| 42 | - ); |
|
| 42 | + ); |
|
| 43 | 43 | } catch (\Exception $e) { |
| 44 | 44 | |
| 45 | - return new JsonResponse([ |
|
| 45 | + return new JsonResponse([ |
|
| 46 | 46 | 'response' => [ |
| 47 | - 'data' => [], |
|
| 48 | - 'count' => 0, |
|
| 49 | - 'error' => $e->getMessage(), |
|
| 50 | - 'success' => false, |
|
| 47 | + 'data' => [], |
|
| 48 | + 'count' => 0, |
|
| 49 | + 'error' => $e->getMessage(), |
|
| 50 | + 'success' => false, |
|
| 51 | 51 | ], |
| 52 | - ], 500); |
|
| 52 | + ], 500); |
|
| 53 | + } |
|
| 53 | 54 | } |
| 54 | - } |
|
| 55 | 55 | } |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | { |
| 25 | 25 | |
| 26 | 26 | try { |
| 27 | - $payload = json_decode($request->getContent()); |
|
| 28 | - $people = $this->service->discoveryPeople($payload->email, $payload->name); |
|
| 27 | + $payload = json_decode($request->getContent()); |
|
| 28 | + $people = $this->service->discoveryPeople($payload->email, $payload->name); |
|
| 29 | 29 | |
| 30 | 30 | $user = $this->service->createUser( |
| 31 | 31 | $people, |