mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 12:41:36 +10:00
recipient token model and sending endpoint
This commit is contained in:
@ -7,9 +7,9 @@ import prisma from "@documenso/prisma";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
const user = await getUserFromToken(req, res);
|
||||
const existingUser = await getUserFromToken(req, res);
|
||||
const { id: documentId } = req.query;
|
||||
if (!user) return;
|
||||
const { token: recipientToken } = req.query;
|
||||
|
||||
if (!documentId) {
|
||||
res.status(400).send("Missing parameter documentId.");
|
||||
@ -25,9 +25,13 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (!document)
|
||||
res.status(404).end(`No document with id ${documentId} found.`);
|
||||
|
||||
const recipients = prisma.recipient.findMany({
|
||||
where: { documentId: +documentId },
|
||||
});
|
||||
|
||||
// todo sign stuff
|
||||
|
||||
res.status(200);
|
||||
return res.status(200).end();
|
||||
}
|
||||
|
||||
export default defaultHandler({
|
||||
|
||||
Reference in New Issue
Block a user