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 39de60d209de3080fa0d3341b601df29b8edfb07..90c036f39ae8c2a4091ecd0cc98dd4076f131575 100644 (file)
@@ -119,7 +119,7 @@ class ApiController extends Controller
                         'grauphel.api.user', array('username' => $username)
                     )
                 ),
                         '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)
                     )
                 ),
                         '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,
             ),
             'latest-sync-revision' => $syncdata->latestSyncRevision,
             'current-sync-guid'    => $syncdata->currentSyncGuid,
index 621d12062979c35ed2e193b82903d47f6f853a7b..d1fe7e3b8f99c5d5a723728811f7310063052005 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'],
             );
                 ),
                 'title' => $row['note_title'],
             );