@@ -135,7 +135,7 @@ defmodule Algora.Bounties do
135
135
command_id = opts [ :command_id ]
136
136
shared_with = opts [ :shared_with ] || [ ]
137
137
138
- Repo . transact ( fn ->
138
+ Repo . tx ( fn ->
139
139
with { :ok , % { installation_id: installation_id , token: token } } <-
140
140
Workspace . resolve_installation_and_token ( opts [ :installation_id ] , repo_owner , creator ) ,
141
141
{ :ok , ticket } <- Workspace . ensure_ticket ( token , repo_owner , repo_name , number ) ,
@@ -213,7 +213,7 @@ defmodule Algora.Bounties do
213
213
def create_bounty ( % { creator: creator , owner: owner , amount: amount , title: title , description: description } , opts ) do
214
214
shared_with = opts [ :shared_with ] || [ ]
215
215
216
- Repo . transact ( fn ->
216
+ Repo . tx ( fn ->
217
217
with { :ok , ticket } <-
218
218
% Ticket { type: :issue }
219
219
|> Ticket . changeset ( % { title: title , description: description } )
@@ -564,7 +564,7 @@ defmodule Algora.Bounties do
564
564
} ,
565
565
opts \\ [ ]
566
566
) do
567
- Repo . transact ( fn ->
567
+ Repo . tx ( fn ->
568
568
with { :ok , % { installation_id: installation_id , token: token } } <-
569
569
Workspace . resolve_installation_and_token ( opts [ :installation_id ] , source_repo_owner , user ) ,
570
570
{ :ok , target } <- Workspace . ensure_ticket ( token , target_repo_owner , target_repo_name , target_number ) ,
@@ -733,7 +733,7 @@ defmodule Algora.Bounties do
733
733
) ::
734
734
{ :ok , String . t ( ) } | { :error , atom ( ) }
735
735
def create_tip ( % { creator: creator , owner: owner , recipient: recipient , amount: amount } , opts \\ [ ] ) do
736
- Repo . transact ( fn ->
736
+ Repo . tx ( fn ->
737
737
case do_create_tip ( % { creator: creator , owner: owner , recipient: recipient , amount: amount } , opts ) do
738
738
{ :ok , tip } ->
739
739
create_payment_session (
@@ -957,7 +957,7 @@ defmodule Algora.Bounties do
957
957
958
958
bounty_id = if bounty = opts [ :bounty ] , do: bounty . id
959
959
960
- Repo . transact ( fn ->
960
+ Repo . tx ( fn ->
961
961
with { :ok , _charge } <-
962
962
initialize_charge ( % {
963
963
id: Nanoid . generate ( ) ,
@@ -1019,7 +1019,7 @@ defmodule Algora.Bounties do
1019
1019
1020
1020
bounty_id = if bounty = opts [ :bounty ] , do: bounty . id
1021
1021
1022
- Repo . transact ( fn ->
1022
+ Repo . tx ( fn ->
1023
1023
with { :ok , _charge } <-
1024
1024
initialize_charge ( % {
1025
1025
id: Nanoid . generate ( ) ,
@@ -1588,7 +1588,7 @@ defmodule Algora.Bounties do
1588
1588
1589
1589
@ spec delete_bounty ( Bounty . t ( ) ) :: { :ok , Bounty . t ( ) } | { :error , Ecto.Changeset . t ( ) }
1590
1590
def delete_bounty ( % Bounty { } = bounty ) do
1591
- Repo . transact ( fn ->
1591
+ Repo . tx ( fn ->
1592
1592
with { :ok , updated_bounty } <-
1593
1593
bounty
1594
1594
|> Bounty . changeset ( % { status: :cancelled } )
0 commit comments