summaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'controllers')
-rw-r--r--controllers/controllers.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php
index 05b6c06..b983675 100644
--- a/controllers/controllers.php
+++ b/controllers/controllers.php
@@ -277,6 +277,19 @@ $app->get('/favorite.js', function() use($app) {
}
});
+$app->post('/favorite', function() use($app) {
+ if($user=require_login($app)) {
+ $params = $app->request()->params();
+
+ $r = create_favorite($user, $params['url']);
+
+ $app->response()->body(json_encode(array(
+ 'location' => $r['location'],
+ 'error' => $r['error']
+ )));
+ }
+});
+
$app->get('/micropub/syndications', function() use($app) {
if($user=require_login($app)) {
$data = get_syndication_targets($user);