Edit collection (#173)
* Collection edit modal * Add icon * 💚 * Oh look, some specs * Delete collection * Remove from collection * Handle error responses Protect against deleting last collection * Fix key * 💚 * Keyboard navigate documents list * Add missing database constraints
This commit is contained in:
@@ -155,12 +155,11 @@ class Document extends BaseModel {
|
||||
// }
|
||||
res = await client.post('/documents.create', data);
|
||||
}
|
||||
|
||||
invariant(res && res.data, 'Data should be available');
|
||||
this.updateData({
|
||||
...res.data,
|
||||
runInAction('Document#save', () => {
|
||||
invariant(res && res.data, 'Data should be available');
|
||||
this.updateData(res.data);
|
||||
this.hasPendingChanges = false;
|
||||
});
|
||||
this.hasPendingChanges = false;
|
||||
} catch (e) {
|
||||
this.errors.add('Document failed saving');
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user