Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit a247e2b

Browse files
committed
feat(blog-thread): test wip
1 parent 450508a commit a247e2b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

lib/groupher_server/cms/delegates/comment_curd.ex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
2626
%{community: community, body: body} = args,
2727
%User{id: user_id}
2828
) do
29-
with {:ok, action} <- match_action(thread, :comment),
29+
with {:ok, action} <- match_action(:post, :comment),
3030
{:ok, content} <- ORM.find(action.target, content_id),
3131
{:ok, user} <- ORM.find(User, user_id) do
3232
Multi.new()
@@ -48,7 +48,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
4848
%{community: community, body: body} = args,
4949
%User{id: user_id} = user
5050
) do
51-
with {:ok, action} <- match_action(thread, :comment),
51+
with {:ok, action} <- match_action(:post, :comment),
5252
{:ok, comment} <- ORM.find(action.reactor, comment_id) do
5353
next_floor = get_next_floor(thread, action.reactor, comment)
5454

@@ -70,7 +70,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
7070
Creates a comment for psot, job ...
7171
"""
7272
def update_comment(thread, id, %{body: body}, %User{id: user_id}) do
73-
with {:ok, action} <- match_action(thread, :comment),
73+
with {:ok, action} <- match_action(:post, :comment),
7474
{:ok, content} <- ORM.find(action.reactor, id),
7575
true <- content.author_id == user_id do
7676
ORM.update(content, %{body: body})
@@ -81,7 +81,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
8181
Delete the comment and increase all the floor after this comment
8282
"""
8383
def delete_comment(thread, content_id) do
84-
with {:ok, action} <- match_action(thread, :comment),
84+
with {:ok, action} <- match_action(:post, :comment),
8585
{:ok, comment} <- ORM.find(action.reactor, content_id) do
8686
Multi.new()
8787
|> Multi.run(:delete_comment, fn _, _ ->
@@ -99,7 +99,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
9999
list paged comments
100100
"""
101101
def paged_comments(thread, content_id, %{page: page, size: size} = filters) do
102-
with {:ok, action} <- match_action(thread, :comment) do
102+
with {:ok, action} <- match_action(:post, :comment) do
103103
dynamic = dynamic_comment_where(thread, content_id)
104104

105105
action.reactor
@@ -114,7 +114,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
114114
list paged comments participators
115115
"""
116116
def paged_comments_participators(thread, content_id, %{page: page, size: size} = filters) do
117-
with {:ok, action} <- match_action(thread, :comment) do
117+
with {:ok, action} <- match_action(:post, :comment) do
118118
dynamic = dynamic_comment_where(thread, content_id)
119119

120120
action.reactor
@@ -133,7 +133,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
133133
end
134134

135135
def paged_replies(thread, comment_id, %User{id: user_id}) do
136-
with {:ok, action} <- match_action(thread, :comment) do
136+
with {:ok, action} <- match_action(:post, :comment) do
137137
action.reactor
138138
|> where([c], c.author_id == ^user_id)
139139
|> join(:inner, [c], r in assoc(c, :reply_to))

lib/groupher_server/cms/models/job.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ defmodule GroupherServer.CMS.Model.Job do
2222
field(:company, :string)
2323
field(:company_link, :string)
2424
field(:desc, :string)
25-
field(:body, :string)
2625

2726
field(:link_addr, :string)
2827
field(:copy_right, :string)

0 commit comments

Comments
 (0)