remove subscription endpoint
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user