Change if/else on checking if end-user is subscribed
This commit is contained in:
parent
75837fa2f7
commit
c16c43f2d4
1 changed files with 7 additions and 1 deletions
|
@ -10,13 +10,19 @@ let { data: subs } = await supabase
|
||||||
.select("*")
|
.select("*")
|
||||||
.eq('UserSubscribed', id)
|
.eq('UserSubscribed', id)
|
||||||
.eq('Id', CreatorId)
|
.eq('Id', CreatorId)
|
||||||
|
|
||||||
|
if (subs[0] === undefined) {
|
||||||
|
var Subbed = false
|
||||||
|
} else {
|
||||||
|
var Subbed = true
|
||||||
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<Base Title="Supabase Demo">
|
<Base Title="Supabase Demo">
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||||
<p style="font-size: 18px; font-weight: bold;">Vsause</p>
|
<p style="font-size: 18px; font-weight: bold;">Vsause</p>
|
||||||
<div>
|
<div>
|
||||||
{subs[0].Subscribed ?
|
{Subbed ?
|
||||||
<a style="font-size: 14px;" href={"/api/account/subscription/remove?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Unsubscribe</a>
|
<a style="font-size: 14px;" href={"/api/account/subscription/remove?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Unsubscribe</a>
|
||||||
:
|
:
|
||||||
<a style="font-size: 14px;" href={"/api/account/subscription/add?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Subscribe</a>
|
<a style="font-size: 14px;" href={"/api/account/subscription/add?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Subscribe</a>
|
||||||
|
|
Loading…
Reference in a new issue