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

Commit 7d931bf

Browse files
committed
chore: clean up some warning
1 parent 3cc9159 commit 7d931bf

File tree

7 files changed

+5
-14
lines changed

7 files changed

+5
-14
lines changed

lib/mastani_server/cms/delegates/article_curd.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ defmodule MastaniServer.CMS.Delegate.ArticleCURD do
161161
{:error, result}
162162
end
163163

164-
defp create_content_result({:error, :log_action, result, _steps}) do
164+
defp create_content_result({:error, :log_action, _result, _steps}) do
165165
{:error, [message: "log action", code: ecode(:create_fails)]}
166166
end
167167

168168
# if empty just pass
169-
defp set_tags(community, thread, content_id, []), do: {:ok, "pass"}
169+
defp set_tags(_community, _thread, _content_id, []), do: {:ok, "pass"}
170170

171171
defp set_tags(community, thread, content_id, tags) do
172172
try do

lib/mastani_server/cms/delegates/article_operation.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ defmodule MastaniServer.CMS.Delegate.ArticleOperation do
44
"""
55
import MastaniServer.CMS.Utils.Matcher
66
import Ecto.Query, warn: false
7-
import Helper.ErrorCode
7+
# import Helper.ErrorCode
88
import ShortMaps
99

1010
alias Helper.ORM
11-
alias MastaniServer.Accounts.User
1211

1312
alias MastaniServer.CMS.{
1413
Community,
@@ -43,7 +42,7 @@ defmodule MastaniServer.CMS.Delegate.ArticleOperation do
4342
defp do_set_flag(content, community_id, attrs) do
4443
with {:ok, content} <- ORM.find(content.__struct__, content.id),
4544
{:ok, community} <- ORM.find(Community, community_id),
46-
{:ok, record} <- insert_flag_record(content, community_id, attrs) do
45+
{:ok, record} <- insert_flag_record(content, community.id, attrs) do
4746
{:ok, struct(content, %{pin: record.pin, trash: record.trash})}
4847
end
4948
end

lib/mastani_server/cms/delegates/comment_curd.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ defmodule MastaniServer.CMS.Delegate.CommentCURD do
6969

7070
defp delete_comment_result({:ok, %{delete_comment: result}}), do: {:ok, result}
7171

72-
defp delete_comment_result({:error, :delete_comment, result, _steps}) do
72+
defp delete_comment_result({:error, :delete_comment, _result, _steps}) do
7373
{:error, [message: "delete comment fails", code: ecode(:delete_fails)]}
7474
end
7575

lib/mastani_server/cms/job_community_flag.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ defmodule MastaniServer.CMS.JobCommunityFlag do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7-
alias Helper.Certification
8-
alias MastaniServer.Accounts
97
alias MastaniServer.CMS.{Community, Job}
108

119
@required_fields ~w(job_id community_id)a

lib/mastani_server/cms/post_community_flag.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ defmodule MastaniServer.CMS.PostCommunityFlag do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7-
alias Helper.Certification
8-
alias MastaniServer.Accounts
97
alias MastaniServer.CMS.{Community, Post}
108

119
@required_fields ~w(post_id community_id)a

lib/mastani_server/cms/repo_community_flag.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ defmodule MastaniServer.CMS.RepoCommunityFlag do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7-
alias Helper.Certification
8-
alias MastaniServer.Accounts
97
alias MastaniServer.CMS.{Community, Repo}
108

119
@required_fields ~w(repo_id community_id)a

lib/mastani_server/cms/video_community_flag.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ defmodule MastaniServer.CMS.VideoCommunityFlag do
44

55
use Ecto.Schema
66
import Ecto.Changeset
7-
alias Helper.Certification
8-
alias MastaniServer.Accounts
97
alias MastaniServer.CMS.{Community, Video}
108

119
@required_fields ~w(video_id community_id)a

0 commit comments

Comments
 (0)