wip: cloud
This commit is contained in:
@@ -21,5 +21,5 @@ export default createHandler(() => (
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
), {
|
), {
|
||||||
mode: "async",
|
mode: "sync",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,20 +42,13 @@ const removeKey = action(async (id: string) => {
|
|||||||
const getBillingInfo = query(async () => {
|
const getBillingInfo = query(async () => {
|
||||||
"use server"
|
"use server"
|
||||||
return withActor(async () => {
|
return withActor(async () => {
|
||||||
const now = Date.now()
|
|
||||||
console.log("getting actor")
|
|
||||||
const actor = Actor.assert("user")
|
const actor = Actor.assert("user")
|
||||||
console.log("getting user")
|
const [user, billing, payments, usage] = await Promise.all([
|
||||||
const user = await User.fromID(actor.properties.userID)
|
User.fromID(actor.properties.userID),
|
||||||
console.log("getting billing")
|
Billing.get(),
|
||||||
const billing = await Billing.get()
|
Billing.payments(),
|
||||||
console.log("getting payments")
|
Billing.usages(),
|
||||||
const payments = await Billing.payments()
|
])
|
||||||
console.log("getting usage")
|
|
||||||
const usage = await Billing.usages()
|
|
||||||
console.log("getBillingInfo", {
|
|
||||||
duration: Date.now() - now,
|
|
||||||
})
|
|
||||||
return { user, billing, payments, usage }
|
return { user, billing, payments, usage }
|
||||||
})
|
})
|
||||||
}, "billingInfo")
|
}, "billingInfo")
|
||||||
|
|||||||
Reference in New Issue
Block a user