slideManager = $teamService; } /** * @param ServerRequestInterface $request * @return JsonResponse * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ public function update(ServerRequestInterface $request) { $id = $request->getAttribute('id'); $data = $this->getRequestData($request); try { return new JsonResponse($this->slideManager->changePosition((int)$id, (int)$data['position'])); } catch (\InvalidArgumentException $e) { return new JsonResponse([ 'message' => $e->getMessage(), ], 500); } } }