Fix notebook drag highlight and add drag-to-tag and drag-to-trash support
This commit is contained in:
1 parent
0f24af880b
commit
2cc202ce03
2 files changed
+304
-87
No files matched your search
@@ -188,6 +188,19 @@ export async function PATCH(
|
||||
}
|
||||
}
|
||||
|
||||
if (body.addTagId && typeof body.addTagId === 'string') {
|
||||
await prisma.noteTag.createMany({
|
||||
data: [{ noteId: id, tagId: body.addTagId }],
|
||||
skipDuplicates: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (body.removeTagId && typeof body.removeTagId === 'string') {
|
||||
await prisma.noteTag.deleteMany({
|
||||
where: { noteId: id, tagId: body.removeTagId },
|
||||
});
|
||||
}
|
||||
|
||||
const updated = await prisma.note.update({
|
||||
where: { id },
|
||||
data,
|
||||
|
||||
Reference in new issue
Block a user