remove subscription endpoint

This commit is contained in:
2026-01-17 16:39:48 -03:00
parent d26abc02c9
commit d0a9998bf4
19 changed files with 450 additions and 192 deletions

View File

@@ -53,33 +53,18 @@ export const workspaceMiddleware = async (
({ id }) => id === org_id
) as Workspace
const [subscription, address] = await Promise.all([
req({
url: `/orgs/${activeWorkspace.id}/subscription`,
request,
context
})
.then((r) => r.json())
.then(emptyObjectToNull),
req({
url: `/orgs/${activeWorkspace.id}/address`,
request,
context
})
.then((r) => r.json())
.then(emptyObjectToNull)
])
const org = (await req({
url: `/orgs/${activeWorkspace.id}`,
request,
context
}).then((r) => r.json())) as any
context.set(workspaceContext, {
activeWorkspace,
workspaces,
subscription,
address
subscription: org?.['subscription'] || null,
address: org?.['address'] || null
})
return await next()
}
const emptyObjectToNull = (data: any) =>
data && Object.keys(data).length === 0 ? null : data