diff options
author | Aaron Parecki <aaron@parecki.com> | 2014-12-26 15:02:54 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2014-12-26 15:02:54 -0800 |
commit | 875a9fd90944eef8bf94f24594c80b9433ec824d (patch) | |
tree | 3d45c54394b2f5cbc6a5f8fa897c1773d2625013 | |
parent | 8be498a324954f9d5792ca921b7364f53ff4085f (diff) |
actually post likes from the form
-rw-r--r-- | controllers/controllers.php | 13 |
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); |