mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-25 07:42:14 +08:00
chore: add debug log
This commit is contained in:
@ -8,6 +8,7 @@ const prisma = new PrismaClient();
|
||||
|
||||
// Returns the login user email or the client IP address
|
||||
export const getEndUser = async (req: NextApiRequest, res: NextApiResponse): Promise<string> => {
|
||||
console.log("getEndUser");
|
||||
// Get from server session if available
|
||||
const serverSession = await getServerSession(req, res, authOptions);
|
||||
if (serverSession?.user?.email) {
|
||||
|
@ -18,6 +18,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
id: conversation.id,
|
||||
},
|
||||
});
|
||||
console.log("collect");
|
||||
const endUser = await getEndUser(req, res);
|
||||
if (chat) {
|
||||
await prisma.message.createMany({
|
||||
|
@ -7,6 +7,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
return res.status(405).json([]);
|
||||
}
|
||||
|
||||
console.log("payment");
|
||||
const endUser = await getEndUser(req, res);
|
||||
const paymentList = await getPaymentListByEmail(endUser);
|
||||
|
||||
|
@ -12,6 +12,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
return res.status(405).json([]);
|
||||
}
|
||||
|
||||
console.log("usage");
|
||||
const endUser = await getEndUser(req, res);
|
||||
|
||||
// Get from server session if available
|
||||
|
Reference in New Issue
Block a user