fix(database): remove prompt popup, create database inline with default name
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

Clicking Database button now creates the table directly in the page
without asking for a name (uses 'Database' as default). Same pattern
as Notion: one click, inline embed, no popup.
This commit is contained in:
2026-07-22 17:02:14 -04:00
parent 59fc7b7975
commit 6ebfc245f1
+3 -4
View File
@@ -325,21 +325,20 @@
// ── v4.6.0: Get Started actions ──
async createDatabase(){
const name=prompt('Database name:',this.pageTitle||'New Database');
if(!name||!name.trim())return;
const csrf=document.cookie.match(/csrf_token=([^;]+)/);
try{
const name='Database';
// Create collection via API
const r=await fetch('/db/api',{
method:'POST',headers:{'Content-Type':'application/json','X-CSRF-Token':csrf?csrf[1]:''},
body:JSON.stringify({name:name.trim()})
body:JSON.stringify({name:name})
});
const d=await r.json();
if(d.id){
// Add inline database embed block to the page
this.blocks.push(this.mkB('embed','',{embed_type:'collection',collection_id:d.id}));
this.render(); this.dirty=true; this.autoSave();
this.showToast('Database created: '+d.name);
this.showToast('Database created');
}else{
this.showToast('Failed to create database');
}