mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
WIP backend userOrMePicker
This commit is contained in:
parent
ec5c4d51b3
commit
b2b1865837
@ -66,7 +66,7 @@ class EntityToJsonTransformer implements DataTransformerInterface
|
||||
]);
|
||||
}
|
||||
|
||||
private function denormalizeOne(array $item)
|
||||
private function denormalizeOne(array|string $item)
|
||||
{
|
||||
if (!\array_key_exists('type', $item)) {
|
||||
throw new TransformationFailedException('the key "type" is missing on element');
|
||||
@ -76,6 +76,17 @@ class EntityToJsonTransformer implements DataTransformerInterface
|
||||
throw new TransformationFailedException('the key "id" is missing on element');
|
||||
}
|
||||
|
||||
if ('me' === $item) {
|
||||
// return the denormalized current user
|
||||
/* return
|
||||
$this->denormalizer->denormalize(
|
||||
['type' => $item['type'], 'id' => $item['id']],
|
||||
User::class,
|
||||
'json',
|
||||
$context,
|
||||
);*/
|
||||
}
|
||||
|
||||
$class = match ($this->type) {
|
||||
'user' => User::class,
|
||||
'person' => Person::class,
|
||||
|
@ -68,7 +68,7 @@ class ReferrerFilter implements FilterInterface
|
||||
{
|
||||
$builder
|
||||
->add('accepted_referrers', PickUserOrMeDynamicType::class, [
|
||||
'multiple' => true,
|
||||
'multiple' => false,
|
||||
])
|
||||
/* ->add('accepted_referrers', PickUserDynamicType::class, [
|
||||
'multiple' => true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user