mirror of
https://github.com/docmost/docmost.git
synced 2025-11-23 03:01:11 +10:00
Make colloboration module not dependant on page module
* add unloadImmediately to collab
This commit is contained in:
@ -4,6 +4,7 @@ import { KyselyDB, KyselyTransaction } from '../../types/kysely.types';
|
||||
import { dbOrTx } from '../../utils';
|
||||
import {
|
||||
InsertablePageHistory,
|
||||
Page,
|
||||
PageHistory,
|
||||
UpdatablePageHistory,
|
||||
} from '@docmost/db/types/entity.types';
|
||||
@ -64,6 +65,21 @@ export class PageHistoryRepo {
|
||||
.executeTakeFirst();
|
||||
}
|
||||
|
||||
async saveHistory(page: Page): Promise<void> {
|
||||
await this.insertPageHistory({
|
||||
pageId: page.id,
|
||||
title: page.title,
|
||||
content: page.content,
|
||||
slug: page.slug,
|
||||
icon: page.icon,
|
||||
version: 1, // TODO: make incremental
|
||||
coverPhoto: page.coverPhoto,
|
||||
lastUpdatedById: page.lastUpdatedById ?? page.creatorId,
|
||||
spaceId: page.spaceId,
|
||||
workspaceId: page.workspaceId,
|
||||
});
|
||||
}
|
||||
|
||||
async findPageHistoryByPageId(pageId: string, pagination: PaginationOptions) {
|
||||
const query = this.db
|
||||
.selectFrom('pageHistory')
|
||||
|
||||
Reference in New Issue
Block a user