From acfcd362b34bf0ef4ea733c3446c91a9fb3e2478 Mon Sep 17 00:00:00 2001 From: phamhieu Date: Mon, 21 Mar 2022 14:46:39 +0700 Subject: [PATCH] chore: studio doesn't need org/project creation apis --- studio/pages/api/organizations/new.ts | 21 --------------------- studio/pages/api/projects/new.ts | 21 --------------------- 2 files changed, 42 deletions(-) delete mode 100644 studio/pages/api/organizations/new.ts delete mode 100644 studio/pages/api/projects/new.ts diff --git a/studio/pages/api/organizations/new.ts b/studio/pages/api/organizations/new.ts deleted file mode 100644 index 9c650a9a3e9..00000000000 --- a/studio/pages/api/organizations/new.ts +++ /dev/null @@ -1,21 +0,0 @@ -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 'POST': - return handlePost(req, res) - default: - res.setHeader('Allow', ['POST']) - res.status(405).json({ data: null, error: { message: `Method ${method} Not Allowed` } }) - } -} - -const handlePost = async (req: NextApiRequest, res: NextApiResponse) => { - // Platform specific endpoint - return res.status(200).json({ slug: 'default-org-slug' }) -} diff --git a/studio/pages/api/projects/new.ts b/studio/pages/api/projects/new.ts deleted file mode 100644 index 23053a547ff..00000000000 --- a/studio/pages/api/projects/new.ts +++ /dev/null @@ -1,21 +0,0 @@ -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 'POST': - return handlePost(req, res) - default: - res.setHeader('Allow', ['POST']) - res.status(405).json({ data: null, error: { message: `Method ${method} Not Allowed` } }) - } -} - -const handlePost = async (req: NextApiRequest, res: NextApiResponse) => { - // Platform specific endpoint - return res.status(200).json({ ref: 'default' }) -}