mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 10:06:17 +08:00
feat: shared link list (#14200)
#### PR Dependency Tree * **PR #14200** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added a "Shared Links" panel to workspace management, enabling admins to view all published documents within a workspace * Added publication date tracking for published documents, now displayed alongside shared links * **Chores** * Removed deprecated `publicPages` field; use `publicDocs` instead <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -484,12 +484,10 @@ export class DocModel extends BaseModel {
|
||||
/**
|
||||
* Find the workspace public doc metas.
|
||||
*/
|
||||
async findPublics(workspaceId: string) {
|
||||
async findPublics(workspaceId: string, order: 'asc' | 'desc' = 'asc') {
|
||||
return await this.db.workspaceDoc.findMany({
|
||||
where: {
|
||||
workspaceId,
|
||||
public: true,
|
||||
},
|
||||
where: { workspaceId, public: true },
|
||||
orderBy: { publishedAt: order },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -524,6 +522,7 @@ export class DocModel extends BaseModel {
|
||||
return await this.upsertMeta(workspaceId, docId, {
|
||||
public: true,
|
||||
mode,
|
||||
publishedAt: new Date(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -536,6 +535,7 @@ export class DocModel extends BaseModel {
|
||||
|
||||
return await this.upsertMeta(workspaceId, docId, {
|
||||
public: false,
|
||||
publishedAt: null,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user