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

Commit 20b0aae

Browse files
committed
chore: wip
1 parent 88573ca commit 20b0aae

File tree

5 files changed

+15
-122
lines changed

5 files changed

+15
-122
lines changed

lib/groupher_server/cms/delegates/community_curd.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ defmodule GroupherServer.CMS.Delegate.CommunityCURD do
5858
@doc """
5959
create a Tag base on type: post / tuts ...
6060
"""
61-
# TODO: change to create_tag(community, thread, attrs, ....)
6261
def create_tag(%Community{id: community_id}, thread, attrs, %Accounts.User{id: user_id}) do
6362
with {:ok, action} <- match_action(thread, :tag),
6463
{:ok, author} <- ensure_author_exists(%Accounts.User{id: user_id}),

lib/groupher_server_web/resolvers/cms_resolver.ex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,12 @@ defmodule GroupherServerWeb.Resolvers.CMS do
103103
do_pin_content(id, community_id, thread)
104104
end
105105

106-
def pin_content(_root, ~m(id community_id)a, _info) do
107-
CMS.pin_content(%CMS.Post{id: id}, %Community{id: community_id})
108-
end
109-
110106
def undo_pin_content(_root, ~m(id community_id thread)a, _info) do
111107
do_undo_pin_content(id, community_id, thread)
112108
end
113109

114-
def undo_pin_content(_root, ~m(id community_id)a, _info) do
115-
CMS.undo_pin_content(%CMS.Post{id: id}, %Community{id: community_id})
110+
def do_pin_content(id, community_id, :post) do
111+
CMS.pin_content(%CMS.Post{id: id}, %Community{id: community_id})
116112
end
117113

118114
def do_pin_content(id, community_id, :job) do
@@ -123,6 +119,10 @@ defmodule GroupherServerWeb.Resolvers.CMS do
123119
CMS.pin_content(%CMS.Repo{id: id}, %Community{id: community_id})
124120
end
125121

122+
def do_undo_pin_content(id, community_id, :post) do
123+
CMS.undo_pin_content(%CMS.Post{id: id}, %Community{id: community_id})
124+
end
125+
126126
def do_undo_pin_content(id, community_id, :job) do
127127
CMS.undo_pin_content(%CMS.Job{id: id}, %Community{id: community_id})
128128
end

test/groupher_server_web/mutation/cms/cms_test.exs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,17 @@ defmodule GroupherServer.Test.Mutation.CMS.Basic do
216216
assert belong_community["id"] == to_string(community.id)
217217
end
218218

219-
@tag :wip3
220-
test "auth user create duplicate tag fails", ~m(community)a do
221-
variables = mock_attrs(:tag, %{communityId: community.id})
219+
# TODO: @tag :wip2
220+
# test "auth user create duplicate tag fails", ~m(community)a do
221+
# variables = mock_attrs(:tag, %{communityId: community.id})
222222

223-
passport_rules = %{community.title => %{"post.tag.create" => true}}
224-
rule_conn = simu_conn(:user, cms: passport_rules)
223+
# passport_rules = %{community.title => %{"post.tag.create" => true}}
224+
# rule_conn = simu_conn(:user, cms: passport_rules)
225225

226-
assert nil !== rule_conn |> mutation_result(@create_tag_query, variables, "createTag")
226+
# assert nil !== rule_conn |> mutation_result(@create_tag_query, variables, "createTag")
227227

228-
assert rule_conn |> mutation_get_error?(@create_tag_query, variables, ecode(:changeset))
229-
end
228+
# assert rule_conn |> mutation_get_error?(@create_tag_query, variables, ecode(:changeset))
229+
# end
230230

231231
# TODO: server return 400 wrong status code
232232
# see https://github.com/absinthe-graphql/absinthe/issues/554

test/groupher_server_web/mutation/cms/radar_test.exs

Lines changed: 0 additions & 106 deletions
This file was deleted.

test/groupher_server_web/query/cms/paged_posts_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ defmodule GroupherServer.Test.Query.PagedPosts do
186186
assert results["totalCount"] == 1
187187
end
188188

189-
@tag :wip2
189+
@tag :wip
190190
test "read state all filter should work", ~m(user)a do
191191
user_conn = simu_conn(:user, user)
192192
{:ok, community} = db_insert(:community)

0 commit comments

Comments
 (0)