Skip to content

Commit

Permalink
Merge pull request #147 from kaichaosun/fix
Browse files Browse the repository at this point in the history
Fix the validate rule and build command
  • Loading branch information
shurco authored Jul 25, 2024
2 parents b5cf737 + 0f36efc commit 0dd99c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "VITE_CJS_IGNORE_WARNING=true vite --host",
"build": "VITE_CJS_IGNORE_WARNING=true build --mode production",
"build": "VITE_CJS_IGNORE_WARNING=true vite build --mode production",
"preview": "vite preview --host",
"update": "bun update --latest"
},
Expand Down
6 changes: 3 additions & 3 deletions web/admin/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import * as rules from "@vee-validate/rules";
import "@/assets/app.css";

// validate rules
Object.keys(rules).forEach((rule) => {
defineRule(rule, rules[rule]);
});
Object.keys(rules)
.filter(rule => typeof rules[rule] === "function")
.forEach(rule => defineRule(rule, rules[rule]));
defineRule("amount", (value) => {
if (!value || !value.length) {
return true;
Expand Down

0 comments on commit 0dd99c9

Please sign in to comment.