mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-17 09:47:23 +00:00
Move next js project to archive (#207)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import validateRequest from '@/config/nextConnect/middleware/validateRequest';
|
||||
import { getBeerStyle } from '@/controllers/posts/beer-styles';
|
||||
import { GetBeerStyleByIdRequest } from '@/controllers/posts/beer-styles/types';
|
||||
|
||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { createRouter } from 'next-connect';
|
||||
import { z } from 'zod';
|
||||
|
||||
const router = createRouter<
|
||||
GetBeerStyleByIdRequest,
|
||||
NextApiResponse<z.infer<typeof APIResponseValidationSchema>>
|
||||
>();
|
||||
|
||||
router.get(
|
||||
validateRequest({ querySchema: z.object({ postId: z.string().cuid() }) }),
|
||||
getBeerStyle,
|
||||
);
|
||||
|
||||
const handler = router.handler();
|
||||
|
||||
export default handler;
|
||||
Reference in New Issue
Block a user