Merge branch 'master' into develop

This commit is contained in:
Alexandre Bodin 2020-05-06 21:48:20 +02:00
commit b109d6878e
4 changed files with 12 additions and 9 deletions

View File

@ -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',
],

View File

@ -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'

View File

@ -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) {

View File

@ -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', () => {