@@ -35,7 +35,7 @@ defmodule GroupherServer.CMS.Delegate.CommunityOperation do
3535 """
3636 def unset_category ( % Community { id: community_id } , % Category { id: category_id } ) do
3737 with { :ok , community_category } <-
38- CommunityCategory |> ORM . findby_delete ( ~m( community_id category_id) a ) do
38+ CommunityCategory |> ORM . findby_delete! ( ~m( community_id category_id) a ) do
3939 Community |> ORM . find ( community_category . community_id )
4040 end
4141 end
@@ -54,7 +54,7 @@ defmodule GroupherServer.CMS.Delegate.CommunityOperation do
5454 """
5555 def unset_thread ( % Community { id: community_id } , % Thread { id: thread_id } ) do
5656 with { :ok , community_thread } <-
57- CommunityThread |> ORM . findby_delete ( ~m( community_id thread_id) a ) do
57+ CommunityThread |> ORM . findby_delete! ( ~m( community_id thread_id) a ) do
5858 Community |> ORM . find ( community_thread . community_id )
5959 end
6060 end
@@ -80,7 +80,7 @@ defmodule GroupherServer.CMS.Delegate.CommunityOperation do
8080 unset a community editor
8181 """
8282 def unset_editor ( % Community { id: community_id } , % User { id: user_id } ) do
83- with { :ok , _ } <- ORM . findby_delete ( CommunityEditor , ~m( user_id community_id) a ) ,
83+ with { :ok , _ } <- ORM . findby_delete! ( CommunityEditor , ~m( user_id community_id) a ) ,
8484 { :ok , _ } <- PassportCURD . delete_passport ( % User { id: user_id } ) do
8585 User |> ORM . find ( user_id )
8686 end
@@ -132,7 +132,7 @@ defmodule GroupherServer.CMS.Delegate.CommunityOperation do
132132 with { :ok , community } <- ORM . find ( Community , community_id ) ,
133133 true <- community . raw !== "home" ,
134134 { :ok , record } <-
135- ORM . findby_delete ( CommunitySubscriber , community_id: community . id , user_id: user_id ) do
135+ ORM . findby_delete! ( CommunitySubscriber , community_id: community . id , user_id: user_id ) do
136136 Community |> ORM . find ( record . community_id )
137137 else
138138 false ->
@@ -151,7 +151,7 @@ defmodule GroupherServer.CMS.Delegate.CommunityOperation do
151151 with { :ok , community } <- ORM . find ( Community , community_id ) ,
152152 true <- community . raw !== "home" ,
153153 { :ok , record } <-
154- CommunitySubscriber |> ORM . findby_delete ( community_id: community . id , user_id: user_id ) do
154+ CommunitySubscriber |> ORM . findby_delete! ( community_id: community . id , user_id: user_id ) do
155155 update_community_geo ( community_id , user_id , remote_ip , :dec )
156156 Community |> ORM . find ( record . community_id )
157157 else
@@ -171,7 +171,7 @@ defmodule GroupherServer.CMS.Delegate.CommunityOperation do
171171 with { :ok , community } <- ORM . find ( Community , community_id ) ,
172172 true <- community . raw !== "home" ,
173173 { :ok , record } <-
174- CommunitySubscriber |> ORM . findby_delete ( community_id: community . id , user_id: user_id ) do
174+ CommunitySubscriber |> ORM . findby_delete! ( community_id: community . id , user_id: user_id ) do
175175 update_community_geo_map ( community . id , city , :dec )
176176 Community |> ORM . find ( record . community_id )
177177 else
0 commit comments