server/src/app/Http/Controllers/Api/DocumentController.php
changeset 128 bc18286e55b2
parent 125 e550b10fe3ca
child 130 fac22d8c2df8
equal deleted inserted replaced
127:5cd8c3065c38 128:bc18286e55b2
    28         $paginator = $this->documentRepository->paginateAll();
    28         $paginator = $this->documentRepository->paginateAll();
    29         $res = $paginator->toArray();
    29         $res = $paginator->toArray();
    30         if(array_key_exists('data', $res)) {
    30         if(array_key_exists('data', $res)) {
    31             $documents = $res['data'];
    31             $documents = $res['data'];
    32             unset($res['data']);
    32             unset($res['data']);
    33             $res['documents'] = $this->documentRepository->resolveLexvo($documents);
    33             //$res['documents'] = $this->documentRepository->resolveLexvo($documents);
    34         }
    34         }
    35         return response()->json($res);
    35         return response()->json($res);
    36     }
    36     }
    37 
    37 
    38     /**
    38     /**
    63      * @return Response
    63      * @return Response
    64      */
    64      */
    65     public function show($id)
    65     public function show($id)
    66     {
    66     {
    67         $doc = $this->documentRepository->get($id);
    67         $doc = $this->documentRepository->get($id);
    68         $this->documentRepository->resolveLexvo([$doc,]);
       
    69         if(is_null($doc)) {
    68         if(is_null($doc)) {
    70             abort(404);
    69             abort(404);
    71         }
    70         }
       
    71         //$this->documentRepository->resolveLexvo([$doc,]);
    72         return response()->json(["document" => $doc]);
    72         return response()->json(["document" => $doc]);
    73     }
    73     }
    74 
    74 
    75     /**
    75     /**
    76      * Show the form for editing the specified resource.
    76      * Show the form for editing the specified resource.