feat: workspace default edit preference (#2319)

This commit is contained in:
Philip Okugbe
2026-06-30 01:10:51 +01:00
committed by GitHub
parent 96faff7175
commit 15bdf680d9
11 changed files with 157 additions and 3 deletions
@@ -271,4 +271,22 @@ export class WorkspaceRepo {
.executeTakeFirst();
}
async updateDefaultPageEditMode(
workspaceId: string,
pageEditMode: string,
trx?: KyselyTransaction,
) {
const db = dbOrTx(this.db, trx);
return db
.updateTable('workspaces')
.set({
settings: sql`COALESCE(settings, '{}'::jsonb)
|| jsonb_build_object('defaultPageEditMode', ${sql.lit(pageEditMode)})`,
updatedAt: new Date(),
})
.where('id', '=', workspaceId)
.returning(this.baseFields)
.executeTakeFirst();
}
}