Web: Files: versionHistory: added action restoreVersion
This commit is contained in:
parent
6498cd542e
commit
b15e6db9cc
@ -1603,3 +1603,14 @@ export function markAsVersion(id, isVersion, version) {
|
||||
.then((versions) => dispatch(setFileVersions(versions)));
|
||||
};
|
||||
}
|
||||
|
||||
export function restoreVersion(id, version) {
|
||||
return (dispatch, getState) => {
|
||||
return api.files.versionRestore(id, version).then((newVersion) => {
|
||||
const state = getState();
|
||||
const versions = getFileVersions(state);
|
||||
versions.unshift(newVersion);
|
||||
dispatch(setFileVersions(versions));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
@ -585,7 +585,6 @@ const filesReducer = (state = initialState, action) => {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
case SET_FILE_VERSIONS: {
|
||||
return Object.assign({}, state, {
|
||||
versionHistory: {
|
||||
|
Loading…
Reference in New Issue
Block a user