@@ -40,7 +40,7 @@ defmodule MastaniServer.Accounts.Delegate.FavoriteCategory do
4040 def delete_favorite_category ( % User { id: user_id } , id ) do
4141 with { :ok , category } <- FavoriteCategory |> ORM . find_by ( ~m( id user_id) a ) do
4242 Multi . new ( )
43- |> Multi . run ( :downgrade_achievement , fn _ ->
43+ |> Multi . run ( :downgrade_achievement , fn _ , _ ->
4444 # find user favvoried-contents(posts & jobs & videos) 's author,
4545 # and downgrade their's acieveents
4646 # NOTE: this is too fucking violent and should be refactor later
@@ -67,7 +67,7 @@ defmodule MastaniServer.Accounts.Delegate.FavoriteCategory do
6767
6868 { :ok , % { done: true } }
6969 end )
70- |> Multi . run ( :delete_category , fn _ ->
70+ |> Multi . run ( :delete_category , fn _ , _ ->
7171 category |> ORM . delete ( )
7272 end )
7373 |> Repo . transaction ( )
@@ -138,7 +138,7 @@ defmodule MastaniServer.Accounts.Delegate.FavoriteCategory do
138138 with { :ok , favorite_category } <-
139139 FavoriteCategory |> ORM . find_by ( % { user_id: user . id , id: category_id } ) do
140140 Multi . new ( )
141- |> Multi . run ( :favorite_content , fn _ ->
141+ |> Multi . run ( :favorite_content , fn _ , _ ->
142142 with { :ok , content_favorite } <- find_content_favorite ( thread , content_id , user . id ) do
143143 check_dup_category ( content_favorite , favorite_category )
144144 else
@@ -149,7 +149,7 @@ defmodule MastaniServer.Accounts.Delegate.FavoriteCategory do
149149 end
150150 end
151151 end )
152- |> Multi . run ( :dec_old_category_count , fn % { favorite_content: content_favorite } ->
152+ |> Multi . run ( :dec_old_category_count , fn _ , % { favorite_content: content_favorite } ->
153153 with false <- is_nil ( content_favorite . category_id ) ,
154154 { :ok , old_category } <- FavoriteCategory |> ORM . find ( content_favorite . category_id ) do
155155 old_category
@@ -159,10 +159,10 @@ defmodule MastaniServer.Accounts.Delegate.FavoriteCategory do
159159 error -> { :error , error }
160160 end
161161 end )
162- |> Multi . run ( :update_content_category_id , fn % { favorite_content: content_favorite } ->
162+ |> Multi . run ( :update_content_category_id , fn _ , % { favorite_content: content_favorite } ->
163163 content_favorite |> ORM . update ( % { category_id: favorite_category . id } )
164164 end )
165- |> Multi . run ( :update_category_info , fn _ ->
165+ |> Multi . run ( :update_category_info , fn _ , _ ->
166166 last_updated = Timex . today ( ) |> Timex . to_datetime ( )
167167
168168 favorite_category
@@ -199,10 +199,10 @@ defmodule MastaniServer.Accounts.Delegate.FavoriteCategory do
199199 with { :ok , favorite_category } <-
200200 FavoriteCategory |> ORM . find_by ( % { user_id: user . id , id: category_id } ) do
201201 Multi . new ( )
202- |> Multi . run ( :undo_favorite_action , fn _ ->
202+ |> Multi . run ( :undo_favorite_action , fn _ , _ ->
203203 CMS . undo_reaction ( thread , :favorite , content_id , user )
204204 end )
205- |> Multi . run ( :update_category_info , fn _ ->
205+ |> Multi . run ( :update_category_info , fn _ , _ ->
206206 last_updated = Timex . today ( ) |> Timex . to_datetime ( )
207207
208208 favorite_category
0 commit comments