Added following page to see posts from yourself and people you follow

This commit is contained in:
2026-04-05 14:41:29 -04:00
parent 8077e570f4
commit 4b36131183
6 changed files with 212 additions and 3 deletions

View File

@@ -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

View File

@@ -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]