Add hrefs to API responses
authorChristian Weiske <cweiske@cweiske.de>
Tue, 28 Oct 2014 16:56:55 +0000 (17:56 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 28 Oct 2014 16:56:55 +0000 (17:56 +0100)
controller/apicontroller.php
lib/notestorage.php

index 39de60d..90c036f 100644 (file)
@@ -119,7 +119,7 @@ class ApiController extends Controller
                         'grauphel.api.user', array('username' => $username)
                     )
                 ),
-                'href' => null,//FIXME
+                'href' => null,
             );
         }
 
@@ -167,7 +167,9 @@ class ApiController extends Controller
                         'grauphel.api.notes', array('username' => $username)
                     )
                 ),
-                'href'    => null,
+                'href'    => $this->deps->urlGen->getAbsoluteURL(
+                    $this->deps->urlGen->linkToRoute('grauphel.gui.index')
+                ),
             ),
             'latest-sync-revision' => $syncdata->latestSyncRevision,
             'current-sync-guid'    => $syncdata->currentSyncGuid,
index 621d120..d1fe7e3 100644 (file)
@@ -432,7 +432,14 @@ class NoteStorage
                             )
                         )
                     ),
-                    'href' => null,//FIXME
+                    'href' => $this->urlGen->getAbsoluteURL(
+                        $this->urlGen->linkToRoute(
+                            'grauphel.gui.note',
+                            array(
+                                'guid' => $row['note_guid']
+                            )
+                        )
+                    ),
                 ),
                 'title' => $row['note_title'],
             );