feat: Trash (#1082)
* wip: trash * Enable restoration of deleted documents * update Trash icon * Add endpoint to trigger garbage collection * fix: account for drafts * fix: Archived documents should be deletable * fix: Missing delete cascade * bump: upgrade rich-markdown-editor
This commit is contained in:
@@ -121,6 +121,14 @@ export default class DocumentsStore extends BaseStore<Document> {
|
||||
);
|
||||
}
|
||||
|
||||
@computed
|
||||
get deleted(): Document[] {
|
||||
return filter(
|
||||
orderBy(this.orderedData, 'deletedAt', 'desc'),
|
||||
d => d.deletedAt
|
||||
);
|
||||
}
|
||||
|
||||
@computed
|
||||
get starredAlphabetical(): Document[] {
|
||||
return naturalSort(this.starred, 'title');
|
||||
@@ -189,6 +197,11 @@ export default class DocumentsStore extends BaseStore<Document> {
|
||||
return this.fetchNamedPage('archived', options);
|
||||
};
|
||||
|
||||
@action
|
||||
fetchDeleted = async (options: ?PaginationParams): Promise<*> => {
|
||||
return this.fetchNamedPage('deleted', options);
|
||||
};
|
||||
|
||||
@action
|
||||
fetchRecentlyUpdated = async (options: ?PaginationParams): Promise<*> => {
|
||||
return this.fetchNamedPage('list', options);
|
||||
|
||||
Reference in New Issue
Block a user