--- a/server/src/app/Http/Controllers/Api/DocumentController.php Tue Feb 23 17:47:57 2016 +0100
+++ b/server/src/app/Http/Controllers/Api/DocumentController.php Tue Feb 23 17:57:46 2016 +0100
@@ -30,7 +30,7 @@
if(array_key_exists('data', $res)) {
$documents = $res['data'];
unset($res['data']);
- $res['documents'] = $this->documentRepository->resolveLexvo($documents);
+ //$res['documents'] = $this->documentRepository->resolveLexvo($documents);
}
return response()->json($res);
}
@@ -65,10 +65,10 @@
public function show($id)
{
$doc = $this->documentRepository->get($id);
- $this->documentRepository->resolveLexvo([$doc,]);
if(is_null($doc)) {
abort(404);
}
+ //$this->documentRepository->resolveLexvo([$doc,]);
return response()->json(["document" => $doc]);
}
--- a/server/src/app/Models/Document.php Tue Feb 23 17:47:57 2016 +0100
+++ b/server/src/app/Models/Document.php Tue Feb 23 17:57:46 2016 +0100
@@ -354,17 +354,22 @@
$this->getContributors()
);
- return [
+ $res = [
'id' => $this->getId(),
'uri' => $this->getUri(),
'title' => $this->getTitleValue(),
'language' => $this->getLanguageValue(),
- 'language_resolved' => $this->getLanguageResolved(),
'modified' => $this->getModifiedValue(),
'publishers' => $publishers,
'contributors' => $contributors,
'mediaArray'=> $mediaArray
];
+
+ if($this->language_resolved) {
+ $res['language_resolved'] = $this->getLanguageResolved();
+ }
+
+ return $res;
}
}