diff --git a/README.md b/README.md index 8865636..588ba4d 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ The Request will be created in the `requests` directory. ``` -- Example html form. +Example html form. ``` @@ -374,7 +374,7 @@ The Request will be created in the `requests` directory. ``` -- Example rules. + Example rules. ``` @@ -418,7 +418,7 @@ The Request will be created in the `requests` directory. ``` -- Example error messages +Example error messages ``` @@ -523,7 +523,7 @@ The Request will be created in the `requests` directory. - Custom - Custom validation `messages` and `attribute` +Custom validation `messages` and `attribute` ``` @@ -571,33 +571,33 @@ Create Custom Rule via cli. The Rule will be created in the `rules` directory. ``` - class GmailRule { + class GmailRule { - constructor() { - } - - /** - * Determine if the validation rule passes. - * @param {*} attribute - * @param {*} value - * @returns bolean - */ - passes(attribute, value) { + constructor() { + } - return value.includes("@gmail.com") - } + /** + * Determine if the validation rule passes. + * @param {*} attribute + * @param {*} value + * @returns bolean + */ + passes(attribute, value) { - /** - * Get the validation error message. - * - * @return string - */ - message() { - return 'The _attribute_ must be using @gmail.com' - } -} + return value.includes("@gmail.com") + } -export default GmailRule + /** + * Get the validation error message. + * + * @return string + */ + message() { + return 'The _attribute_ must be using @gmail.com' + } + } + + export default GmailRule ``` diff --git a/core/service/Media/MediaService.js b/core/service/Media/MediaService.js index 5acc6f3..1ccb806 100644 --- a/core/service/Media/MediaService.js +++ b/core/service/Media/MediaService.js @@ -370,7 +370,7 @@ const saveToLocal = async (file, mediatable_type, mediatable_id) => { */ const saveMedia = async ({ model = Model, file = Object, name = String }) => { if (!file || !file.extension || !name || !model) { - console.log("require all params") + console.log("Save media failed: require all params, Please check file or name") return } const mediatable_id = model.id