Added following page to see posts from yourself and people you follow
This commit is contained in:
@@ -8,6 +8,7 @@ defmodule Mixer.Posts do
|
||||
rpc_action :create_tweet, :create
|
||||
rpc_action :like_tweet, :like
|
||||
rpc_action :read_tweet, :read
|
||||
rpc_action :read_following_feed, :following_feed
|
||||
rpc_action :unlike_tweet, :unlike
|
||||
rpc_action :update_tweet, :update
|
||||
rpc_action :destroy_tweet, :destroy
|
||||
|
||||
@@ -30,6 +30,13 @@ defmodule Mixer.Posts.Tweet do
|
||||
actions do
|
||||
defaults [:read, :destroy]
|
||||
|
||||
read :following_feed do
|
||||
filter expr(
|
||||
user_id == ^actor(:id) or
|
||||
exists(user.followers, follower_id == ^actor(:id))
|
||||
)
|
||||
end
|
||||
|
||||
create :create do
|
||||
upsert? true
|
||||
accept [:content]
|
||||
|
||||
Reference in New Issue
Block a user