feat: Add ability to star collection (#3327)
* Migrations, models, commands * ui * Move starred hint to location state * lint * tsc * refactor * Add collection empty state in expanded sidebar * Add empty placeholder within starred collections * Drag and drop improves, Relative refactor * fix: Starring untitled draft leaves empty space * fix: Creating draft in starred collection shouldnt open main * fix: Dupe drop cursor * Final fixes * fix: Canonical redirect replaces starred location state * fix: Don't show reorder cursor at the top of collection with no permission to edit when dragging
This commit is contained in:
@@ -174,6 +174,19 @@ export default class CollectionsStore extends BaseStore<Collection> {
|
||||
);
|
||||
}
|
||||
|
||||
star = async (collection: Collection) => {
|
||||
await this.rootStore.stars.create({
|
||||
collectionId: collection.id,
|
||||
});
|
||||
};
|
||||
|
||||
unstar = async (collection: Collection) => {
|
||||
const star = this.rootStore.stars.orderedData.find(
|
||||
(star) => star.collectionId === collection.id
|
||||
);
|
||||
await star?.delete();
|
||||
};
|
||||
|
||||
getPathForDocument(documentId: string): DocumentPath | undefined {
|
||||
return this.pathsToDocuments.find((path) => path.id === documentId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user