Skip to content

Commit e7affbd

Browse files
committed
feat: add custom validation functionality for resource columns[2]
1 parent e36cdf0 commit e7affbd

7 files changed

Lines changed: 238 additions & 161 deletions

File tree

adminforth/modules/restApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,10 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
603603
let validation = null;
604604
if (col.validation) {
605605
validation = await Promise.all(
606-
col.validation.map(async (val) => {
606+
col.validation.map(async (val, index) => {
607607
return {
608608
...val,
609-
customValidator: val.validator ? true: false,
609+
customValidator: inCol.validation[index].validator ? true: false,
610610
message: await tr(val.message, `resource.${resource.resourceId}`),
611611
}
612612
})

adminforth/spa/package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adminforth/spa/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"debounce": "^2.1.0",
2626
"flowbite-datepicker": "^1.2.6",
2727
"javascript-time-ago": "^2.5.11",
28+
"lodash.debounce": "^4.0.8",
2829
"pinia": "^2.1.7",
2930
"sanitize-html": "^2.13.0",
3031
"unhead": "^1.9.12",

0 commit comments

Comments
 (0)