mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
feat: Add drawing annotation functionality to comments, including a new canvas component and API integration for creation, retrieval, and updates.
This commit is contained in:
@@ -176,10 +176,10 @@ export async function PATCH(request: NextRequest, { params }: RouteParams) {
|
||||
}
|
||||
|
||||
const body = await request.json();
|
||||
const { content, isResolved, tagId } = body;
|
||||
const { content, isResolved, tagId, annotationData } = body;
|
||||
|
||||
// Only author can edit content or tag
|
||||
if ((content !== undefined || tagId !== undefined) && !isAuthor) {
|
||||
if ((content !== undefined || tagId !== undefined || annotationData !== undefined) && !isAuthor) {
|
||||
return apiErrors.forbidden('Only the author can edit comment content');
|
||||
}
|
||||
|
||||
@@ -191,6 +191,7 @@ export async function PATCH(request: NextRequest, { params }: RouteParams) {
|
||||
const updateData: Record<string, unknown> = {};
|
||||
if (content !== undefined && typeof content === 'string') updateData.content = content.trim();
|
||||
if (tagId !== undefined) updateData.tagId = tagId;
|
||||
if (annotationData !== undefined) updateData.annotationData = annotationData;
|
||||
if (isResolved !== undefined) {
|
||||
updateData.isResolved = isResolved;
|
||||
updateData.resolvedAt = isResolved ? new Date() : null;
|
||||
|
||||
Reference in New Issue
Block a user