Permalink
Browse files

more bug fixes

  • Loading branch information...
1 parent e0c06d7 commit 23eaf88df0f0730c945ba09877612c7d945ce2cd @nov committed May 1, 2009
Showing with 5 additions and 4 deletions.
  1. +2 −1 lib/smartfm/models/list.rb
  2. +2 −2 lib/smartfm/modules/public_content.rb
  3. +1 −1 lib/smartfm/rest_clients/list.rb
@@ -72,7 +72,8 @@ def sentences(params = {})
end
def add_item(auth, item)
- self.rest_client.add_item(auth, {:id => self.id, :item_id => item.id})
+ # id is used for item_id only here..
+ self.rest_client.add_item(auth, {:list_id => self.id, :id => item.id})
end
def delete_item(auth, item)
@@ -11,8 +11,8 @@ def recent(params = {})
self.deserialize(hash) || []
end
- def find(list_id, params = {})
- params[:id] = list_id
+ def find(obj_id, params = {})
+ params[:id] = obj_id
hash = self.rest_client.find(params)
self.deserialize(hash)
end
@@ -8,7 +8,7 @@ class Smartfm::RestClient::List < Smartfm::RestClient::Base
:matching => {:path => '/lists/matching/__keyword__'},
:likes => {:path => '/lists/__id__/likes' },
:create => {:path => '/lists', :http_method => :post},
- :add_item => {:path => '/lists/__id__/items', :http_method => :post},
+ :add_item => {:path => '/lists/__list_id__/items', :http_method => :post}, # id is used for item_id here..
:like! => {:path => '/lists/__id__/likes', :http_method => :post},
:delete => {:path => '/lists/__id__', :http_method => :delete},
:delete_item => {:path => '/lists/__id__/items/__item_id__', :http_method => :delete},

0 comments on commit 23eaf88

Please sign in to comment.