mirror of
https://github.com/neocities/neocities.git
synced 2025-07-27 04:48:20 +02:00
check for missing site record in toggle follow
This commit is contained in:
parent
3a7b7236e7
commit
8d532fc714
1 changed files with 1 additions and 0 deletions
|
@ -186,6 +186,7 @@ post '/site/:site_id/toggle_follow' do |site_id|
|
||||||
require_login
|
require_login
|
||||||
content_type :json
|
content_type :json
|
||||||
site = Site[id: site_id]
|
site = Site[id: site_id]
|
||||||
|
return 404 if site.nil?
|
||||||
return 403 if site.is_blocking?(current_site)
|
return 403 if site.is_blocking?(current_site)
|
||||||
{result: (current_site.toggle_follow(site) ? 'followed' : 'unfollowed')}.to_json
|
{result: (current_site.toggle_follow(site) ? 'followed' : 'unfollowed')}.to_json
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue