feat: enhancements (#2107)

* refactor
* fix
* update packages
This commit is contained in:
Philip Okugbe
2026-04-13 23:34:40 +01:00
committed by GitHub
parent bd68e47e03
commit 4056bd0104
18 changed files with 412 additions and 155 deletions
@@ -207,6 +207,22 @@ export class WatcherRepo {
.execute();
}
async getWatchedSpaceIds(userId: string, workspaceId: string) {
const query = this.db
.selectFrom('watchers')
.select(['watchers.id', 'watchers.spaceId'])
.where('userId', '=', userId)
.where('workspaceId', '=', workspaceId)
.where('pageId', 'is', null)
.where('type', '=', WatcherType.SPACE);
return executeWithCursorPagination(query, {
perPage: 250,
fields: [{ expression: 'watchers.id', direction: 'asc' }],
parseCursor: (cursor) => ({ id: cursor.id }),
});
}
async isWatchingSpace(userId: string, spaceId: string): Promise<boolean> {
const watcher = await this.db
.selectFrom('watchers')