chore: snapshot before performance optimization

This commit is contained in:
Sepehr Ramezani
2026-04-17 21:14:43 +02:00
parent b6a548acd8
commit 2eceb32fd4
95 changed files with 4357 additions and 1942 deletions

View File

@@ -83,9 +83,9 @@ export async function POST(request: NextRequest) {
content: content || '',
color: color || 'default',
type: type || 'text',
checkItems: checkItems ? JSON.stringify(checkItems) : null,
labels: labels ? JSON.stringify(labels) : null,
images: images ? JSON.stringify(images) : null,
checkItems: checkItems ?? null,
labels: labels ?? null,
images: images ?? null,
}
})
@@ -147,11 +147,11 @@ export async function PUT(request: NextRequest) {
if (content !== undefined) updateData.content = content
if (color !== undefined) updateData.color = color
if (type !== undefined) updateData.type = type
if (checkItems !== undefined) updateData.checkItems = checkItems ? JSON.stringify(checkItems) : null
if (labels !== undefined) updateData.labels = labels ? JSON.stringify(labels) : null
if (checkItems !== undefined) updateData.checkItems = checkItems ?? null
if (labels !== undefined) updateData.labels = labels ?? null
if (isPinned !== undefined) updateData.isPinned = isPinned
if (isArchived !== undefined) updateData.isArchived = isArchived
if (images !== undefined) updateData.images = images ? JSON.stringify(images) : null
if (images !== undefined) updateData.images = images ?? null
const note = await prisma.note.update({
where: { id },