fix: workspace — removed topbar buttons, unified modals, parent_id support
- Topbar: removed New File/New Folder buttons + 'Files' label - Breadcrumb: Workspace / work1 instead of work1 / Files - Modals: single shared create modal with focus auto, @keydown.enter - parent_id param: recursive folder/file creation inside folders - Sidebar buttons use same POST /api/local-workspace/items - newPageInWorkspace/newFolderInWorkspace now both use unified API
This commit is contained in:
@@ -545,14 +545,15 @@ async def create_local_workspace_item(request: Request):
|
||||
body = await request.json()
|
||||
name = body.get("name", "Untitled").strip()
|
||||
item_type = body.get("type", "page")
|
||||
parent_id = body.get("parent_id")
|
||||
ws = _get_active_workspace(request)
|
||||
ws_id = ws["id"] if ws else None
|
||||
section = 'Workspace' if item_type == 'folder' else 'Private'
|
||||
with get_conn() as conn:
|
||||
cursor = conn.execute(
|
||||
"INSERT INTO pages (workspace, workspace_id, title, content, content_format, parent_section) "
|
||||
"VALUES ('', ?, ?, '', 'blocks', ?)",
|
||||
(ws_id, name, section),
|
||||
"INSERT INTO pages (workspace, workspace_id, title, content, content_format, parent_section, parent_id) "
|
||||
"VALUES ('', ?, ?, '', 'blocks', ?, ?)",
|
||||
(ws_id, name, section, parent_id),
|
||||
)
|
||||
conn.commit()
|
||||
pid = cursor.lastrowid
|
||||
|
||||
Reference in New Issue
Block a user