Skip to content

Commit

Permalink
[1]. modif readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamena2020 committed Mar 20, 2023
1 parent 4fb5277 commit 5a2d384
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ The Request will be created in the `requests` directory.
```

- Example html form.
Example html form.

```
Expand Down Expand Up @@ -374,7 +374,7 @@ The Request will be created in the `requests` directory.
```

- Example rules.
Example rules.

```
Expand Down Expand Up @@ -418,7 +418,7 @@ The Request will be created in the `requests` directory.
```

- Example error messages
Example error messages

```
Expand Down Expand Up @@ -523,7 +523,7 @@ The Request will be created in the `requests` directory.

- Custom

Custom validation `messages` and `attribute`
Custom validation `messages` and `attribute`

```
Expand Down Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion core/service/Media/MediaService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a2d384

Please sign in to comment.