diff --git a/src/pages/api/feature/feature-create-rule.ts b/src/pages/api/feature/feature-create-rule.ts new file mode 100644 index 000000000..772a3dd48 --- /dev/null +++ b/src/pages/api/feature/feature-create-rule.ts @@ -0,0 +1,21 @@ +import { withAuthenticatedSessionRoute } from "@/lib/infrastructure/auth/session-utils"; +import { NextApiRequest, NextApiResponse } from "next"; + +async function endpoint(req: NextApiRequest, res: NextApiResponse, rucioAuthToken: string) { + if(req.method !== 'POST') { + res.status(405).json({ error: 'Method Not Allowed' }) + return + } + + + const data = req.body + + if(!data) { + res.status(400).json({ error: 'Missing body' }) + return + } + + res.status(200).json(req.body) +} + +export default withAuthenticatedSessionRoute(endpoint); \ No newline at end of file diff --git a/src/pages/api/feature/mock-get-validated-dids.ts b/src/pages/api/feature/mock-get-validated-dids.ts new file mode 100644 index 000000000..ffa1378e0 --- /dev/null +++ b/src/pages/api/feature/mock-get-validated-dids.ts @@ -0,0 +1,30 @@ +import { withAuthenticatedSessionRoute } from "@/lib/infrastructure/auth/session-utils"; +import { NextApiRequest, NextApiResponse } from "next"; +import { fixtureRuleMetaViewModel, generateSequenceArray } from "test/fixtures/table-fixtures"; + +async function endpoint(req: NextApiRequest, res: NextApiResponse, rucioAuthToken: string) { + if(req.method !== 'POST') { + res.status(405).json({ error: 'Method Not Allowed' }) + return + } + if(!req.body) { + res.status(400).json({ error: 'Missing body' }) + return + } + const { dids } = req.body + if(!dids) { + res.status(400).json({ error: 'Missing dids' }) + return + } + const response = dids.map((did: string) => { + return { + did, + is_valid: true, + reason: null + } + }) + + res.status(200).json(response) +} + +export default withAuthenticatedSessionRoute(endpoint); \ No newline at end of file