mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 22:29:11 +03:00
35 lines
944 B
TypeScript
35 lines
944 B
TypeScript
import { NextApiRequest, NextApiResponse } from 'next'
|
|
|
|
import apiWrapper from 'lib/api/apiWrapper'
|
|
|
|
export default (req: NextApiRequest, res: NextApiResponse) => apiWrapper(req, res, handler)
|
|
|
|
async function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
const { method } = req
|
|
|
|
switch (method) {
|
|
case 'GET':
|
|
return handleGetAll(req, res)
|
|
default:
|
|
res.setHeader('Allow', ['GET'])
|
|
res.status(405).json({ data: null, error: { message: `Method ${method} Not Allowed` } })
|
|
}
|
|
}
|
|
|
|
const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
|
|
// Platform specific endpoint
|
|
const response = [
|
|
{
|
|
id: 1,
|
|
name: process.env.DEFAULT_ORGANIZATION_NAME || 'Default Organization',
|
|
slug: 'default-org-slug',
|
|
billing_email: 'billing@supabase.co',
|
|
plan: {
|
|
id: 'enterprise',
|
|
name: 'Enterprise',
|
|
},
|
|
},
|
|
]
|
|
return res.status(200).json(response)
|
|
}
|