mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-09 15:18:11 -05:00
committed by
Benjamin Neff
parent
75f95faebe
commit
9bca03d5e9
@@ -7,17 +7,14 @@ class ShareVisibilitiesController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
|
||||
def update
|
||||
#note :id references a postvisibility
|
||||
params[:shareable_id] ||= params[:post_id]
|
||||
params[:shareable_type] ||= 'Post'
|
||||
|
||||
vis = current_user.toggle_hidden_shareable(accessible_post)
|
||||
render :nothing => true, :status => 200
|
||||
post = post_service.find!(params[:post_id])
|
||||
current_user.toggle_hidden_shareable(post)
|
||||
head :ok
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def accessible_post
|
||||
@post ||= params[:shareable_type].constantize.where(:id => params[:post_id]).select("id, guid, author_id, created_at").first
|
||||
def post_service
|
||||
@post_service ||= PostService.new(current_user)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user