mirror of
https://github.com/dsoaress/link-free.git
synced 2026-08-17 06:56:04 +01:00
feat: add user management section
This commit is contained in:
16
src/api/data/getData.ts
Normal file
16
src/api/data/getData.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { prisma } from 'services/prisma'
|
||||
import { ExceptionError } from 'utils/error'
|
||||
|
||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
export async function getData(_req: NextApiRequest, res: NextApiResponse) {
|
||||
const response = await prisma.data.findUnique({
|
||||
where: { id: 1 }
|
||||
})
|
||||
|
||||
if (!response) {
|
||||
throw new ExceptionError('No data found')
|
||||
}
|
||||
|
||||
res.status(200).json(response?.data)
|
||||
}
|
||||
Reference in New Issue
Block a user