|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Lifecycle callbacks for the `Work` model. |
| 5 | + */ |
| 6 | + |
| 7 | +module.exports = { |
| 8 | + // Before saving a value. |
| 9 | + // Fired before an `insert` or `update` query. |
| 10 | + // beforeSave: async (model, attrs, options) => {}, |
| 11 | + |
| 12 | + // After saving a value. |
| 13 | + // Fired after an `insert` or `update` query. |
| 14 | + // afterSave: async (model, response, options) => {}, |
| 15 | + |
| 16 | + // Before fetching a value. |
| 17 | + // Fired before a `fetch` operation. |
| 18 | + // beforeFetch: async (model, columns, options) => {}, |
| 19 | + |
| 20 | + // After fetching a value. |
| 21 | + // Fired after a `fetch` operation. |
| 22 | + // afterFetch: async (model, response, options) => {}, |
| 23 | + |
| 24 | + // Before fetching all values. |
| 25 | + // Fired before a `fetchAll` operation. |
| 26 | + // beforeFetchAll: async (model, columns, options) => {}, |
| 27 | + |
| 28 | + // After fetching all values. |
| 29 | + // Fired after a `fetchAll` operation. |
| 30 | + // afterFetchAll: async (model, response, options) => {}, |
| 31 | + |
| 32 | + // Before creating a value. |
| 33 | + // Fired before an `insert` query. |
| 34 | + // beforeCreate: async (model, attrs, options) => {}, |
| 35 | + |
| 36 | + // After creating a value. |
| 37 | + // Fired after an `insert` query. |
| 38 | + // afterCreate: async (model, attrs, options) => {}, |
| 39 | + |
| 40 | + // Before updating a value. |
| 41 | + // Fired before an `update` query. |
| 42 | + // beforeUpdate: async (model, attrs, options) => {}, |
| 43 | + |
| 44 | + // After updating a value. |
| 45 | + // Fired after an `update` query. |
| 46 | + // afterUpdate: async (model, attrs, options) => {}, |
| 47 | + |
| 48 | + // Before destroying a value. |
| 49 | + // Fired before a `delete` query. |
| 50 | + // beforeDestroy: async (model, attrs, options) => {}, |
| 51 | + |
| 52 | + // After destroying a value. |
| 53 | + // Fired after a `delete` query. |
| 54 | + // afterDestroy: async (model, attrs, options) => {} |
| 55 | +}; |
0 commit comments