feat: Allow unpublishing documents (#1467)

* Allow unpublishing documents

* add block unpublish files that has children

* add api tests to new route
This commit is contained in:
Guilherme DIniz
2020-09-01 00:03:05 -03:00
committed by GitHub
parent de59147418
commit 0aa338cccc
7 changed files with 159 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
// @flow
import addDays from "date-fns/add_days";
import invariant from "invariant";
import { action, set, observable, computed } from "mobx";
import { action, computed, observable, set } from "mobx";
import parseTitle from "shared/utils/parseTitle";
import unescape from "shared/utils/unescape";
import DocumentsStore from "stores/DocumentsStore";
@@ -145,6 +145,10 @@ export default class Document extends BaseModel {
return this.store.restore(this, revision);
};
unpublish = () => {
return this.store.unpublish(this);
};
@action
enableEmbeds = () => {
this.embedsDisabled = false;