mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 10:55:37 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
b109d6878e
@ -214,7 +214,6 @@ module.exports = {
|
||||
'/3.0.0-beta.x/guides/secure-your-app',
|
||||
'/3.0.0-beta.x/guides/send-email',
|
||||
'/3.0.0-beta.x/guides/registering-a-field-in-admin',
|
||||
'/3.0.0-beta.x/guides/count-graphql',
|
||||
'/3.0.0-beta.x/guides/client',
|
||||
'/3.0.0-beta.x/guides/update-version',
|
||||
],
|
||||
|
||||
@ -111,7 +111,7 @@ runtime: nodejs10
|
||||
instance_class: F2
|
||||
|
||||
env_variables:
|
||||
HOST: '<project_id>.appspot.com'
|
||||
HOST: '0.0.0.0'
|
||||
NODE_ENV: 'production'
|
||||
DATABASE_NAME: 'strapi'
|
||||
DATABASE_USERNAME: 'postgres'
|
||||
@ -132,7 +132,7 @@ runtime: nodejs10
|
||||
env: flex
|
||||
|
||||
env_variables:
|
||||
HOST: '<project_id>.appspot.com'
|
||||
HOST: '0.0.0.0'
|
||||
NODE_ENV: 'production'
|
||||
DATABASE_NAME: 'strapi'
|
||||
DATABASE_USERNAME: 'postgres'
|
||||
|
||||
@ -101,11 +101,11 @@ class DatabaseManager {
|
||||
return _.get(strapi.admin, ['models', key]);
|
||||
}
|
||||
|
||||
return (
|
||||
_.get(strapi.plugins, [plugin, 'models', key]) ||
|
||||
_.get(strapi, ['models', key]) ||
|
||||
_.get(strapi, ['components', key])
|
||||
);
|
||||
if (plugin) {
|
||||
return _.get(strapi.plugins, [plugin, 'models', key]);
|
||||
}
|
||||
|
||||
return _.get(strapi, ['models', key]) || _.get(strapi, ['components', key]);
|
||||
}
|
||||
|
||||
getModelByCollectionName(collectionName) {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
const parseType = require('../parse-type');
|
||||
const format = require('date-fns/format');
|
||||
|
||||
describe('parseType', () => {
|
||||
describe('boolean', () => {
|
||||
@ -50,7 +51,10 @@ describe('parseType', () => {
|
||||
|
||||
expect(parseType({ type: 'date', value: '2018-11-02' })).toBe('2018-11-02');
|
||||
|
||||
expect(parseType({ type: 'date', value: '2019-04-21T00:00:00.000Z' })).toBe('2019-04-21');
|
||||
const isoDateFormat = new Date().toISOString();
|
||||
const expectedDateFormat = format(new Date(isoDateFormat), 'yyyy-MM-dd');
|
||||
|
||||
expect(parseType({ type: 'date', value: isoDateFormat })).toBe(expectedDateFormat);
|
||||
});
|
||||
|
||||
it('Throws on invalid formator dates', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user