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:
@@ -112,6 +112,7 @@ Document.associate = models => {
|
||||
Document.belongsTo(models.Collection, {
|
||||
as: 'collection',
|
||||
foreignKey: 'atlasId',
|
||||
onDelete: 'cascade',
|
||||
});
|
||||
Document.belongsTo(models.User, {
|
||||
as: 'createdBy',
|
||||
@@ -121,6 +122,10 @@ Document.associate = models => {
|
||||
as: 'updatedBy',
|
||||
foreignKey: 'lastModifiedById',
|
||||
});
|
||||
Document.hasMany(models.Revision, {
|
||||
as: 'revisions',
|
||||
onDelete: 'cascade',
|
||||
});
|
||||
Document.hasMany(models.Star, {
|
||||
as: 'starred',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user