add accepted cover requests
This commit is contained in:
@ -35,6 +35,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
throw new Error('Model is required as a part of the URL path.');
|
||||
}
|
||||
const modelName = modelArray[0]; // Get the first part of the model array
|
||||
if (!prisma[modelName]) {
|
||||
throw new Error(`Model ${modelName} not found in Prisma client.`);
|
||||
}
|
||||
const result = await prisma[modelName].findMany(queryOptions);
|
||||
res.status(200).json(result);
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user