MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / update

Function update

apps/web/pages/api/count/index.tsx:5–12  ·  view source on GitHub ↗
(request: NextApiRequest, response: NextApiResponse)

Source from the content-addressed store, hash-verified

3import { cors, preflight } from 'utilities/cors';
4
5async function update(request: NextApiRequest, response: NextApiResponse) {
6 const incrementId = request.query.incrementId as string;
7 await prisma.threads.update({
8 where: { incrementId: parseInt(incrementId) },
9 data: { viewCount: { increment: 1 } },
10 });
11 return response.status(200).json({});
12}
13
14async function handler(request: NextApiRequest, response: NextApiResponse) {
15 if (request.method === 'OPTIONS') {

Callers 1

handlerFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected