mirror of
https://github.com/docmost/docmost.git
synced 2026-08-26 00:07:04 +08:00
feat: synced blocks (transclusion) (#2163)
* feat: synced blocks (transclusion) * fix:remove name * make placeholders smaller * feat: enforce strict transclusion schema * fix: scope synced blocks to workspace, gate unsync on edit permission * fix collab module error
This commit is contained in:
@@ -100,6 +100,30 @@ export class PageRepo {
|
||||
return query.executeTakeFirst();
|
||||
}
|
||||
|
||||
async findManyByIds(
|
||||
pageIds: string[],
|
||||
opts?: {
|
||||
trx?: KyselyTransaction;
|
||||
workspaceId?: string;
|
||||
},
|
||||
): Promise<Page[]> {
|
||||
if (pageIds.length === 0) return [];
|
||||
const db = dbOrTx(this.db, opts?.trx);
|
||||
|
||||
let query = db
|
||||
.selectFrom('pages')
|
||||
.select(this.baseFields)
|
||||
.where('id', 'in', pageIds);
|
||||
|
||||
if (opts?.workspaceId) {
|
||||
query = query
|
||||
.where('workspaceId', '=', opts.workspaceId)
|
||||
.where('deletedAt', 'is', null);
|
||||
}
|
||||
|
||||
return query.execute();
|
||||
}
|
||||
|
||||
async updatePage(
|
||||
updatablePage: UpdatablePage,
|
||||
pageId: string,
|
||||
|
||||
Reference in New Issue
Block a user