Skip to content

Commit

Permalink
temporary remove subclass query parameter in GetShortObjectDescriptio…
Browse files Browse the repository at this point in the history
…nAction
  • Loading branch information
mpoiriert committed Jun 15, 2022
1 parent 01cb6d0 commit ca0fcab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Action/GetShortObjectDescriptionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ public function __invoke(Request $request): Response
throw new BadRequestParamHttpException('objectId', ['string', 'int'], $objectId);
}

$subclass = $request->query->get('subclass');
$request->query->remove('subclass');

$object = $admin->getObject($objectId);
if (null === $object) {
throw new NotFoundHttpException(sprintf('Could not find subject for id "%s"', $objectId));
}

if ($subclass) {
$request->query->set('subclass', $subclass);
}

if ('json' === $request->get('_format')) {
return new JsonResponse(['result' => [
'id' => $admin->id($object),
Expand Down

0 comments on commit ca0fcab

Please sign in to comment.