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

Commit 1793257

Browse files
committed
refactor(clean up): rm unnecessary pattern matching
1 parent 8f8689a commit 1793257

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/mastani_server/cms/delegates/article_operation.ex

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,7 @@ defmodule MastaniServer.CMS.Delegate.ArticleOperation do
9797
@doc """
9898
trash / untrash articles
9999
"""
100-
def set_community_flags(%Post{id: _} = content, community_id, attrs),
101-
do: do_set_flag(content, community_id, attrs)
102-
103-
def set_community_flags(%Job{id: _} = content, community_id, attrs),
104-
do: do_set_flag(content, community_id, attrs)
105-
106-
def set_community_flags(%CMSRepo{id: _} = content, community_id, attrs),
107-
do: do_set_flag(content, community_id, attrs)
108-
109-
def set_community_flags(%Video{id: _} = content, community_id, attrs),
110-
do: do_set_flag(content, community_id, attrs)
111-
112-
defp do_set_flag(content, community_id, attrs) do
100+
def set_community_flags(content, community_id, attrs) do
113101
with {:ok, content} <- ORM.find(content.__struct__, content.id),
114102
{:ok, community} <- ORM.find(Community, community_id),
115103
{:ok, record} <- insert_flag_record(content, community.id, attrs) do

0 commit comments

Comments
 (0)