mirror of
https://github.com/strapi/strapi.git
synced 2025-07-15 04:53:17 +00:00
95 lines
1.8 KiB
Plaintext
95 lines
1.8 KiB
Plaintext
![]() |
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Module dependencies
|
||
|
*/
|
||
|
|
||
|
// Public node modules.
|
||
|
const _ = require('lodash');
|
||
|
|
||
|
// Settings for the `<%= globalID %>` model.
|
||
|
const settings = require('./<%= globalID %>.settings.json');
|
||
|
|
||
|
/**
|
||
|
* Export the `<%= globalID %>` model
|
||
|
*/
|
||
|
|
||
|
module.exports = {
|
||
|
|
||
|
/**
|
||
|
* Basic settings
|
||
|
*/
|
||
|
|
||
|
// The identity to use.
|
||
|
identity: settings.identity,
|
||
|
|
||
|
// The connection to use.
|
||
|
connection: settings.connection,
|
||
|
|
||
|
// Do you want to respect schema?
|
||
|
schema: settings.schema,
|
||
|
|
||
|
// Limit for a get request on the list.
|
||
|
limit: settings.limit,
|
||
|
|
||
|
// Merge simple attributes from settings with those ones.
|
||
|
attributes: _.merge(settings.attributes, {
|
||
|
|
||
|
}),
|
||
|
|
||
|
// Do you automatically want to have time data?
|
||
|
autoCreatedAt: settings.autoCreatedAt,
|
||
|
autoUpdatedAt: settings.autoUpdatedAt
|
||
|
|
||
|
/**
|
||
|
* Lifecycle callbacks on validate
|
||
|
*/
|
||
|
|
||
|
// Before validating value
|
||
|
// beforeValidate: function (values, next) {
|
||
|
// next();
|
||
|
// }
|
||
|
|
||
|
/**
|
||
|
* Lifecycle callbacks on create
|
||
|
*/
|
||
|
|
||
|
// Before creating a value.
|
||
|
// beforeCreate: (model, attrs, options) => {
|
||
|
// return new Promise();
|
||
|
// },
|
||
|
|
||
|
// After creating a value.
|
||
|
// afterCreate: (model, attrs, options) => {
|
||
|
// return new Promise();
|
||
|
// },
|
||
|
|
||
|
/**
|
||
|
* Lifecycle callbacks on update
|
||
|
*/
|
||
|
|
||
|
// Before updating a value.
|
||
|
// beforeUpdate: (model, attrs, options) => {
|
||
|
// return new Promise();
|
||
|
// },
|
||
|
|
||
|
// After updating a value.
|
||
|
// afterUpdate: (model, attrs, options) => {
|
||
|
// return new Promise();
|
||
|
// },
|
||
|
|
||
|
/**
|
||
|
* Lifecycle callbacks on destroy
|
||
|
*/
|
||
|
|
||
|
// Before updating a value.
|
||
|
// beforeDestroy: (model, attrs, options) => {
|
||
|
// return new Promise();
|
||
|
// },
|
||
|
|
||
|
// After updating a value.
|
||
|
// afterDestroy: (model, attrs, options) => {
|
||
|
// return new Promise();
|
||
|
// }
|
||
|
};
|