mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 23:59:08 +03:00
Add an API page for run-lints endpoint.
This commit is contained in:
1 parent
423397e858
commit
46a509a996
1 file changed
+24
@@ -0,0 +1,24 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
import apiWrapper from 'lib/api/apiWrapper'
|
||||
import { extractResponse } from 'pages/api/constants'
|
||||
|
||||
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 handleGet(req, res)
|
||||
default:
|
||||
res.setHeader('Allow', ['GET'])
|
||||
res.status(405).json({ data: null, error: { message: `Method ${method} Not Allowed` } })
|
||||
}
|
||||
}
|
||||
|
||||
type ResponseData = extractResponse<'/platform/projects/{ref}/run-lints', 'get'>
|
||||
|
||||
const handleGet = async (req: NextApiRequest, res: NextApiResponse<ResponseData>) => {
|
||||
return res.status(200).json([])
|
||||
}
|
||||
Reference in new issue
Block a user