implemented hooks for user-collections & user-collection-entry models to update updatedAt and order fields
This commit is contained in:
1 parent
36866dabe6
commit
cea1b207a3
12 files changed
+170
-61
No files matched your search
+1
-15
@@ -102,18 +102,4 @@ EpisodeSeen.belongsTo(Entry, { foreignKey: 'entry_id' });
|
||||
|
||||
// * ----
|
||||
Franchise.hasMany(Entry, { foreignKey: 'franchise_id' });
|
||||
Entry.belongsTo(Franchise, { foreignKey: 'franchise_id' });
|
||||
|
||||
|
||||
// ! TRIGGERS
|
||||
UserCollectionEntry.afterUpdate(async (instance, options) => {
|
||||
await UserCollection.update(instance.user_collection_id, {
|
||||
updatedAt: new Date()
|
||||
})
|
||||
});
|
||||
|
||||
UserCollectionEntry.afterDestroy(async (instance, options) => {
|
||||
await UserCollection.update(instance.user_collection_id, {
|
||||
updatedAt: new Date()
|
||||
})
|
||||
});
|
||||
Entry.belongsTo(Franchise, { foreignKey: 'franchise_id' });
|
||||
Reference in new issue
Block a user