refs #379. Allow_extra_attributes false
							parent
							
								
									8d3c3c195c
								
							
						
					
					
						commit
						e1d782c8a0
					
				|  | @ -7,6 +7,7 @@ resources: | |||
|             groups: ['default', 'user:read'] | ||||
|         denormalization_context: | ||||
|             groups: ['user:write'] | ||||
| 
 | ||||
|         operations: | ||||
|             ApiPlatform\Metadata\GetCollection: | ||||
|                 provider: App\State\Provider\UserProvider | ||||
|  |  | |||
|  | @ -11,6 +11,8 @@ api_platform: | |||
|         paths: ['%kernel.project_dir%/config/api_platform', '%kernel.project_dir%/src/Dto'] | ||||
|     defaults: | ||||
|         pagination_client_items_per_page: true | ||||
|         denormalization_context: | ||||
|             allow_extra_attributes: false | ||||
|         cache_headers: | ||||
|             vary: [ 'Content-Type', 'Authorization', 'Origin' ] | ||||
|             extra_properties: | ||||
|  |  | |||
|  | @ -48,12 +48,12 @@ class UserProcessor implements ProcessorInterface | |||
|             throw new \Exception(sprintf('data is not instance of %s', UserInput::class)); | ||||
|         } | ||||
| 
 | ||||
|         $entity = null; | ||||
|         $user = null; | ||||
|         if (isset($uriVariables['uuid'])) { | ||||
|             $entity = $this->userRepository->findOneByUuid($uriVariables['uuid']); | ||||
|             $user = $this->userRepository->findOneByUuid($uriVariables['uuid']); | ||||
|         } | ||||
| 
 | ||||
|         $user = $data->createOrUpdateEntity($entity); | ||||
|         $user = $data->createOrUpdateEntity($user); | ||||
| 
 | ||||
|         if ($data->password !== null){ | ||||
|             $user->setPassword($this->userPasswordHasher->hashPassword($user, $data->password)); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue