17 lines
538 B
TypeScript
17 lines
538 B
TypeScript
import { NetworkError, nextHandler } from '../../../src/utils/errors'
|
|
import getConfig from 'next/config'
|
|
import { waitForInitSchemas } from '../../../src/validation/schemas'
|
|
|
|
const {
|
|
publicRuntimeConfig: { TENANT_TYPE }
|
|
} = getConfig()
|
|
|
|
const handler = nextHandler(async (req, res) => {
|
|
if (req.method !== 'GET') throw new NetworkError('Invalid method')
|
|
if (TENANT_TYPE !== 'local') throw new NetworkError('Not allowed', undefined, 400)
|
|
await waitForInitSchemas.resolve()
|
|
res.json({ success: true })
|
|
})
|
|
|
|
export default handler
|