Skip to content

Commit 3efc5d7

Browse files
committed
fix: added logs to stripe connect account creation
1 parent c3de072 commit 3efc5d7

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

src/lib/server/stripe.server.ts

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,28 @@ export async function createAccount(
142142
return
143143
}
144144

145-
const promises = await Promise.all([
146-
supabase.schema("profiles").from("scripters").update({ stripe: account.id }).eq("id", scripter.id),
147-
supabase.schema("profiles").from("balances").update({ stripe: account.id }).eq("id", scripter.id)
148-
])
149-
150-
for (let i = 0; i < promises.length; i++) {
151-
if (promises[i].error) {
152-
console.error(promises[i].error)
153-
return
154-
}
145+
console.log("Stripe Account created: ", account, " for ", scripter.id)
146+
147+
const { error: errScripter } = await supabase
148+
.schema("profiles")
149+
.from("scripters")
150+
.update({ stripe: account.id })
151+
.eq("id", scripter.id)
152+
153+
if (errScripter) {
154+
console.error(errScripter)
155+
return
156+
}
157+
158+
const { error: errBalances } = await supabase
159+
.schema("profiles")
160+
.from("balances")
161+
.update({ stripe: account.id })
162+
.eq("id", scripter.id)
163+
164+
if (errBalances) {
165+
console.error(errBalances)
166+
return
155167
}
156168

157169
try {

src/routes/ThemeSwitcher.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</script>
2020

2121
<div class="my-auto input-group flex hover:preset-tonal">
22-
<Popover>
22+
<Popover {open} onOpenChange={(e) => (open = e.open)}>
2323
<Popover.Trigger class="btn h-full hover:preset-tonal">
2424
<Palette size="16" />
2525
<span class="mx-4 my-auto flex lg:hidden xl:flex">{theme}</span>

0 commit comments

Comments
 (0)