Collection Permissions (#829)

see https://github.com/outline/outline/issues/668
This commit is contained in:
Tom Moor
2019-01-05 13:37:33 -08:00
committed by GitHub
parent 8978915423
commit 8c02b0028c
53 changed files with 1379 additions and 214 deletions

View File

@ -17,11 +17,11 @@ export default class BaseModel {
try {
// ensure that the id is passed if the document has one
if (params) params = { ...params, id: this.id };
await this.store.save(params || this.toJS());
const model = await this.store.save(params || this.toJS());
// if saving is successful set the new values on the model itself
if (params) set(this, params);
return this;
set(this, { ...params, ...model });
return model;
} finally {
this.isSaving = false;
}