Skip to content

Commit

Permalink
Fix promo code creation for submitted twitter handles (#3968)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIvanoff authored Nov 2, 2023
1 parent 392a863 commit 1a15fc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sanbase/billing/user_promo_codes.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ defmodule Sanbase.Billing.UserPromoCode do
This is used when counting how many promo codes in total have been issued
"""
def get_total_user_promo_codes_for_campaign(user_id, campaign) do
from(p in __MODULE__, where: p.user_id == ^user_id and p.campaign == ^campaign)
|> Repo.all()
query = from(p in __MODULE__, where: p.user_id == ^user_id and p.campaign == ^campaign)

{:ok, Repo.all(query)}
end

def is_coupon_usable(nil, _), do: true
Expand Down

0 comments on commit 1a15fc2

Please sign in to comment.