21 lines
699 B
TypeScript
21 lines
699 B
TypeScript
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
import { CorporateUser, User } from "@/interfaces/user";
|
|
import client from "@/lib/mongodb";
|
|
import { getLinkedUsers } from "@/utils/users.be";
|
|
import { uniqBy } from "lodash";
|
|
import type { NextApiRequest, NextApiResponse } from "next";
|
|
import { v4 } from "uuid";
|
|
import fs from 'fs'
|
|
import { findBy, mapBy } from "@/utils";
|
|
import { addUsersToEntity, getEntitiesWithRoles } from "@/utils/entities.be";
|
|
|
|
const db = client.db(process.env.MONGODB_DB);
|
|
|
|
type Data = {
|
|
name: string;
|
|
};
|
|
|
|
export default async function handler(req: NextApiRequest, res: NextApiResponse<Data>) {
|
|
res.status(200).json({ name: "John Doe" });
|
|
}
|