From 12e3eaf61967282086440d62717d6270e0be4362 Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Thu, 2 Nov 2023 16:05:39 +0200 Subject: [PATCH] Fix promo code creation for submitted twitter handles --- lib/sanbase/billing/user_promo_codes.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sanbase/billing/user_promo_codes.ex b/lib/sanbase/billing/user_promo_codes.ex index 216456e39f..2407ef6d82 100644 --- a/lib/sanbase/billing/user_promo_codes.ex +++ b/lib/sanbase/billing/user_promo_codes.ex @@ -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