chore: snapshot before performance optimization
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user