🚧 fields

This commit is contained in:
Timur Ercan
2023-02-14 13:06:49 +01:00
parent 8f17f18d0a
commit 6febc3d38e
2 changed files with 57 additions and 18 deletions

View File

@ -42,7 +42,8 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
id: number;
type: FieldType;
page: number;
position: { x: number; y: number };
positionX: number;
positionY: number;
} = req.body;
if (!user) return;
@ -64,15 +65,17 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
id: +body.id,
},
update: {
positionX: +body.position.x,
positionY: +body.position.y,
type: body.type,
page: +body.page,
positionX: +body.positionX,
positionY: +body.positionY,
},
create: {
documentId: +documentId,
type: body.type,
page: +body.page,
positionX: +body.position.x,
positionY: +body.position.y,
positionX: +body.positionX,
positionY: +body.positionY,
},
});