Merge branch 'master' into fix/1785

This commit is contained in:
Jim LAURIE 2018-09-28 19:43:19 +02:00 committed by GitHub
commit bff434f3ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 41 deletions

View File

@ -1,18 +1,22 @@
<!-- ⚠️ If you do not respect this template your issue will be closed. -->
<!-- ISSUE TEMPLATE -->
<!-- =============================================================================== -->
<!-- ⚠️ If you are not using the current Strapi release, you will be asked to update. -->
<!-- Please see the wiki for guides on upgrading to the latest release. -->
<!-- =============================================================================== -->
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->
<!-- ⚠️ Before writing your issue make sure you are using:-->
<!-- Node 9.x.x -->
<!-- npm 5.x.x -->
<!-- The latest version of Strapi. -->
<!-- Node 10.x.x -->
<!-- npm 6.x.x -->
**Informations**
- **Node.js version**:
- **npm version**:
- **Strapi version**:
- **Database**:
- **Operating system**:
- **Node.js version**:
- **npm version**:
- **Strapi version**: <!-- Please make sure you are on the latest version -->
- **Database**:
- **Operating system**:
**What is the current behavior?**
@ -28,19 +32,3 @@
**Suggested solutions**
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->
<!-- FEATURE REQUEST TEMPLATE -->
<!-- ⚠️ If you do not respect this template your issue will be closed. -->
**What is the expected behavior?**
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->

View File

@ -5,17 +5,23 @@ about: Create a report to help us improve 🤔.
<!-- ⚠️ If you do not respect this template your issue will be closed. -->
<!-- =============================================================================== -->
<!-- ⚠️ If you are not using the current Strapi release, you will be asked to update. -->
<!-- Please see the wiki for guides on upgrading to the latest release. -->
<!-- =============================================================================== -->
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->
<!-- ⚠️ Before writing your issue make sure you are using:-->
<!-- Node 9.x.x -->
<!-- npm 5.x.x -->
<!-- The latest version of Strapi. -->
<!-- Node 10.x.x -->
<!-- npm 6.x.x -->
**Informations**
- **Node.js version**:
- **npm version**:
- **Strapi version**:
- **Database**:
- **Operating system**:
- **Node.js version**:
- **npm version**:
- **Strapi version**: <!-- Please make sure you are on the latest version -->
- **Database**:
- **Operating system**:
**What is the current behavior?**
@ -31,7 +37,3 @@ about: Create a report to help us improve 🤔.
**Suggested solutions**
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->

View File

@ -5,8 +5,8 @@ about: Suggest an idea for this project 💡!
<!-- ⚠️ If you do not respect this template your issue will be closed. -->
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->
**What is the expected behavior?**
<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->

0
packages/strapi-generate-new/files/server.js Normal file → Executable file
View File

View File

@ -1,4 +1,17 @@
import { forEach, isObject, isArray, map, mapKeys, includes, reject, isEmpty, findIndex, isUndefined } from 'lodash';
import {
forEach,
isObject,
isArray,
map,
mapKeys,
includes,
reject,
isEmpty,
findIndex,
isUndefined,
isBoolean,
isNumber,
} from 'lodash';
/* eslint-disable consistent-return */
export function getValidationsFromForm(form, formValidations) {
@ -88,7 +101,7 @@ function validate(value, validations) {
case 'type':
if (validationValue === 'json') {
try {
if (isObject(value)) {
if (isObject(value) || isBoolean(value) || isNumber(value) || isArray(value)) {
value = JSON.parse(JSON.stringify(value));
} else {
errors.push({ id: 'content-manager.error.validation.json' });