1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

star folder (#2955)

This commit is contained in:
lian
2019-02-18 20:26:55 +08:00
committed by Daniel Pan
parent 6a7a47e6cd
commit 5fd5b000e1
11 changed files with 391 additions and 42 deletions

View File

@@ -100,12 +100,13 @@ class DirentListItem extends React.Component {
let dirent = this.props.dirent;
let repoID = this.props.repoID;
let filePath = this.getDirentPath(dirent);
if (dirent.starred) {
seafileAPI.unStarFile(repoID, filePath).then(() => {
seafileAPI.unStarItem(repoID, filePath).then(() => {
this.props.updateDirent(this.props.dirent, 'starred', false);
});
} else {
seafileAPI.starFile(repoID, filePath).then(() => {
seafileAPI.starItem(repoID, filePath).then(() => {
this.props.updateDirent(this.props.dirent, 'starred', true);
});
}