diff options
author | Zach Copley <zach@status.net> | 2009-10-05 10:04:35 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2009-10-05 10:04:35 -0700 |
commit | ee207ffd8be4a7178d06ff7c6928dba3714146ec (patch) | |
tree | 3b9dc947172d45d2714172e5205e5bfaa2176797 /lib/router.php | |
parent | 4ed8055f86d3e3c517a9e367607f60d595b77f37 (diff) |
Routes for friendships actions
Diffstat (limited to 'lib/router.php')
-rw-r--r-- | lib/router.php | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/lib/router.php b/lib/router.php index 75abf58ab..5ee939657 100644 --- a/lib/router.php +++ b/lib/router.php @@ -388,17 +388,33 @@ class Router // friendships - $m->connect('api/friendships/:method/:argument', - array('action' => 'api', - 'apiaction' => 'friendships'), - array('method' => '(create|destroy)')); + $m->connect('api/friendships/show.:format', + array('action' => 'ApiFriendshipsShow', + 'format' => '(xml|json)')); - $m->connect('api/friendships/:method', - array('action' => 'api', - 'apiaction' => 'friendships'), - array('method' => '(show|exists)(\.(xml|json))')); + $m->connect('api/friendships/exists.:format', + array('action' => 'ApiFriendshipsExists', + 'format' => '(xml|json)')); + + $m->connect('api/friendships/create.:format', + array('action' => 'ApiFriendshipsCreate', + 'format' => '(xml|json)')); + + $m->connect('api/friendships/destroy.:format', + array('action' => 'ApiFriendshipsDestroy', + 'format' => '(xml|json)')); + + $m->connect('api/friendships/create/:id.:format', + array('action' => 'ApiFriendshipsCreate', + 'id' => '[a-zA-Z0-9]+', + 'format' => '(xml|json)')); + + $m->connect('api/friendships/destroy/:id.:format', + array('action' => 'ApiFriendshipsDestroy', + 'id' => '[a-zA-Z0-9]+', + 'format' => '(xml|json)')); - // Social graph + // Social graph $m->connect('api/friends/ids/:id.:format', array('action' => 'apiFriends', |