INNER CODE UNIT · JavaScript
handler
urdadx/librelinks · pages/api/analytics/views/index.js:8
export default async function handler(req, res) {
if (req.method !== 'GET') {
return res.status(405).end();
}
try {
const { handle, filter } = req.query;
if (!handle || typeof handle !== 'string') {
return res.status(404).end();
}
const user = await db.user.findUnique({
where: { handle },
select: { id: true },
});
if (!user) {