fix: allow folderId in updateDocument and pass it through route handler
- Add folderId parameter to updateDocument service method - Extract folderId from request body in PUT /documents/:id route - Fixes move document to folder functionality
This commit is contained in:
@@ -469,7 +469,7 @@ export class DocumentService {
|
||||
};
|
||||
}
|
||||
|
||||
async updateDocument(docId, { title, content, tags, type, priority, status }) {
|
||||
async updateDocument(docId, { title, content, tags, type, priority, status, folderId }) {
|
||||
const found = this._findDocById(docId);
|
||||
if (!found) {
|
||||
throw new NotFoundError('Document');
|
||||
@@ -484,6 +484,7 @@ export class DocumentService {
|
||||
if (priority !== undefined) meta.priority = priority;
|
||||
if (status !== undefined) meta.status = status;
|
||||
if (tags !== undefined) meta.tags = tags.filter(t => t);
|
||||
if (folderId !== undefined) meta.folderId = folderId;
|
||||
meta.updatedAt = now;
|
||||
|
||||
// Rewrite markdown file
|
||||
|
||||
Reference in New Issue
Block a user