mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
[shared file, file in shared dir view] use new api for file 'save as' (#4650)
This commit is contained in:
@@ -8,6 +8,7 @@ import { Utils } from '../../utils/utils';
|
||||
|
||||
const propTypes = {
|
||||
sharedToken: PropTypes.string.isRequired,
|
||||
filePath: PropTypes.string,
|
||||
toggleCancel: PropTypes.func.isRequired,
|
||||
handleSaveSharedFile: PropTypes.func.isRequired,
|
||||
};
|
||||
@@ -24,7 +25,8 @@ class SaveSharedFileDialog extends React.Component {
|
||||
}
|
||||
|
||||
onSaveSharedFile = () => {
|
||||
seafileAPI.saveSharedFile(this.state.repo.repo_id, this.state.selectedPath, this.props.sharedToken).then((res) => {
|
||||
const { sharedToken, filePath } = this.props;
|
||||
seafileAPI.saveSharedFile(this.state.repo.repo_id, this.state.selectedPath, sharedToken, filePath).then((res) => {
|
||||
this.props.toggleCancel();
|
||||
this.props.handleSaveSharedFile();
|
||||
}).catch((error) => {
|
||||
|
@@ -135,8 +135,8 @@ class SharedFileView extends React.Component {
|
||||
</div>
|
||||
{this.state.showSaveSharedFileDialog &&
|
||||
<SaveSharedFileDialog
|
||||
repoID={repoID}
|
||||
sharedToken={sharedToken}
|
||||
filePath={zipped ? filePath : ''}
|
||||
toggleCancel={this.toggleCancel}
|
||||
handleSaveSharedFile={this.handleSaveSharedFile}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user