Fix bug.
This commit is contained in:
parent
850956c09d
commit
fd23167f98
|
@ -99,10 +99,12 @@ class SiteFeed
|
|||
request = Net::HTTP::Post.new("/xhr/#{self.channel_key.pluralize}/feed_add_remote/#{self.feed_uid}", 'Content-Type' => 'application/json')
|
||||
request.body = {"url"=>root_url}.to_json
|
||||
response = http_req.request(request)
|
||||
if response.code.to_i == 200
|
||||
self.update(:enable_notify=>true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
def remove_notify
|
||||
if self.enable_notify
|
||||
root_url = Site.first.root_url rescue ""
|
||||
|
@ -116,8 +118,10 @@ class SiteFeed
|
|||
request = Net::HTTP::Post.new("/xhr/#{self.channel_key.pluralize}/feed_remove_remote/#{self.feed_uid}", 'Content-Type' => 'application/json')
|
||||
request.body = {"url"=>root_url}.to_json
|
||||
response = http_req.request(request)
|
||||
if response.code.to_i == 200
|
||||
self.update(:enable_notify=>false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue