Skip to content

Commit 2967524

Browse files
committedNov 21, 2018
Publish after delete
1 parent f1553b5 commit 2967524

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/containers/views/DocumentEdit.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@ export class DocumentEdit extends Component {
7878
};
7979

8080
handleClickDelete = () => {
81-
const { deleteDocument, params } = this.props;
81+
const { deleteDocument, publishDocument, currentDocument, params } = this.props;
82+
const path = currentDocument.path;
8283
const [directory, ...rest] = params.splat;
8384
const filename = rest.join('.');
8485
const confirm = window.confirm(getDeleteMessage(filename));
8586
if (confirm) {
8687
const collection = params.collection_name;
87-
deleteDocument(collection, directory, filename);
88+
deleteDocument(collection, directory, filename).then(() => {
89+
publishDocument(path);
90+
});
8891
browserHistory.push(
8992
`${ADMIN_PREFIX}/collections/${collection}/${directory || ''}`
9093
);

0 commit comments

Comments
 (0)
Please sign in to comment.