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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user