1
0
mirror of synced 2026-08-05 14:47:03 +00:00

backend returns if user is already subscribed

This commit is contained in:
Rimian Perkins
2019-11-28 17:43:03 +11:00
parent c7dcc18923
commit 0fddb5e3b9
6 changed files with 93 additions and 38 deletions
+5 -3
View File
@@ -40,9 +40,11 @@ module DiscoursePatrons
group.add(current_user)
end
unless DiscoursePatrons::Customer.exists?(user_id: current_user.id)
DiscoursePatrons::Customer.create(user_id: current_user.id, customer_id: params[:customer])
end
DiscoursePatrons::Customer.create(
user_id: current_user.id,
customer_id: params[:customer],
product_id: plan[:product]
)
render_json_dump @subscription