chore: Upgrade flow (#1854)
* wip: upgrade flow * chore: More sealed props improvements * Final fixes
This commit is contained in:
@@ -11,7 +11,7 @@ export default class BaseModel {
|
||||
this.store = store;
|
||||
}
|
||||
|
||||
save = async (params: ?Object) => {
|
||||
save = async (params: Object = {}) => {
|
||||
this.isSaving = true;
|
||||
|
||||
try {
|
||||
|
||||
@@ -142,7 +142,7 @@ export default class Document extends BaseModel {
|
||||
};
|
||||
|
||||
@action
|
||||
updateFromJson = (data) => {
|
||||
updateFromJson = (data: Object) => {
|
||||
set(this, data);
|
||||
};
|
||||
|
||||
@@ -150,7 +150,7 @@ export default class Document extends BaseModel {
|
||||
return this.store.archive(this);
|
||||
};
|
||||
|
||||
restore = (options) => {
|
||||
restore = (options: { revisionId?: string, collectionId?: string }) => {
|
||||
return this.store.restore(this, options);
|
||||
};
|
||||
|
||||
@@ -233,7 +233,7 @@ export default class Document extends BaseModel {
|
||||
};
|
||||
|
||||
@action
|
||||
save = async (options: SaveOptions) => {
|
||||
save = async (options: SaveOptions = {}) => {
|
||||
if (this.isSaving) return this;
|
||||
|
||||
const isCreating = !this.id;
|
||||
@@ -246,7 +246,9 @@ export default class Document extends BaseModel {
|
||||
collectionId: this.collectionId,
|
||||
title: this.title,
|
||||
text: this.text,
|
||||
...options,
|
||||
publish: options.publish,
|
||||
done: options.done,
|
||||
autosave: options.autosave,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -257,7 +259,9 @@ export default class Document extends BaseModel {
|
||||
text: this.text,
|
||||
templateId: this.templateId,
|
||||
lastRevision: options.lastRevision,
|
||||
...options,
|
||||
publish: options.publish,
|
||||
done: options.done,
|
||||
autosave: options.autosave,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user