Skip to content

Commit afb88df

Browse files
committed
Protocol.UndefinedError for claims when creating tips
1 parent 1ae2e7a commit afb88df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/algora/bounties/bounties.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ defmodule Algora.Bounties do
307307
def generate_line_items(%{amount: amount}, opts \\ []) do
308308
ticket_ref = opts[:ticket_ref]
309309
recipient = opts[:recipient]
310-
claims = opts[:claims]
310+
claims = opts[:claims] || []
311311

312312
description = if(ticket_ref, do: "#{ticket_ref[:owner]}/#{ticket_ref[:repo]}##{ticket_ref[:number]}")
313313

@@ -393,6 +393,7 @@ defmodule Algora.Bounties do
393393
claims: opts[:claims] || [],
394394
tip_id: opts[:tip_id],
395395
bounty_id: opts[:bounty_id],
396+
claim_id: nil,
396397
amount: amount,
397398
creator_id: owner.id,
398399
group_id: tx_group_id
@@ -678,9 +679,9 @@ defmodule Algora.Bounties do
678679
id: credit_id,
679680
tip_id: params.tip_id,
680681
bounty_id: params.bounty_id,
681-
claim_id: params.claim_id,
682+
claim_id: params[:claim_id],
682683
amount: params.amount,
683-
user_id: params.recipient_id,
684+
user_id: params[:recipient_id],
684685
linked_transaction_id: debit_id,
685686
group_id: params.group_id
686687
}) do

0 commit comments

Comments
 (0)