Adds a new Slack message when connecting a channel for posting
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
import { DataTypes, sequelize } from '../sequelize';
|
||||
import events from '../events';
|
||||
|
||||
const Integration = sequelize.define('integration', {
|
||||
id: {
|
||||
@ -32,4 +33,16 @@ Integration.associate = models => {
|
||||
});
|
||||
};
|
||||
|
||||
Integration.addHook('afterCreate', async model => {
|
||||
events.add({ name: 'integrations.create', model });
|
||||
});
|
||||
|
||||
Integration.addHook('afterUpdate', model =>
|
||||
events.add({ name: 'integrations.update', model })
|
||||
);
|
||||
|
||||
Integration.addHook('afterDestroy', model =>
|
||||
events.add({ name: 'integrations.delete', model })
|
||||
);
|
||||
|
||||
export default Integration;
|
||||
|
Reference in New Issue
Block a user