Comparing version 0.11.23 to 0.11.24
@@ -22,2 +22,3 @@ // @flow | ||
// Alaska | ||
defaultValue: any | void; | ||
label: string; | ||
@@ -24,0 +25,0 @@ path: string; |
@@ -667,2 +667,7 @@ // @flow | ||
doc[key] = objectToData(value, _fields); | ||
} else if (value === undefined) { | ||
let fieldConfig = model._fields[key]; | ||
if (fieldConfig && fieldConfig.defaultValue !== undefined) { | ||
doc[key] = fieldConfig.defaultValue; | ||
} | ||
} else { | ||
@@ -669,0 +674,0 @@ doc[key] = value; |
{ | ||
"name": "alaska", | ||
"version": "0.11.23", | ||
"version": "0.11.24", | ||
"description": "Componentized and pluggable web framework for Node.js", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"debug": "^2.6.8", | ||
"intl-messageformat": "^1.3.0", | ||
"intl-messageformat": "^2.0.0", | ||
"koa": "^2.3.0", | ||
@@ -29,3 +29,3 @@ "koa-compose": "^4.0.0", | ||
"mime": "^1.3.6", | ||
"mongoose": "^4.11.1", | ||
"mongoose": "^4.11.3", | ||
"statuses": "^1.3.1", | ||
@@ -32,0 +32,0 @@ "string-random": "^0.1.0" |
@@ -91,5 +91,5 @@ // @flow | ||
//如果不是普通错误,则输出错误信息 | ||
console.error(`URL: ${ctx.path} ${service.id} API ${error.stack}`); | ||
console.error(`URL: ${ctx.path} ${service.id} API: ${error.message} \n${error.stack}`); | ||
//如果是数据验证错误 | ||
if (error.message === 'Validation failed' && error.errors) { | ||
if (error.message.startsWith('Validation failed') && error.errors) { | ||
for (let key in error.errors) { | ||
@@ -96,0 +96,0 @@ ctx.body = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
118760
4158
+ Addedintl-messageformat@2.2.0(transitive)
+ Addedintl-messageformat-parser@1.4.0(transitive)
- Removedintl-messageformat@1.3.0(transitive)
- Removedintl-messageformat-parser@1.2.0(transitive)
Updatedintl-messageformat@^2.0.0
Updatedmongoose@^4.11.3