Skip to content

Commit

Permalink
refactor(action): handle tablestore action data before submit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon authored and ysfscream committed Dec 17, 2024
1 parent fe3fc56 commit c4d28ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hooks/Rule/useDataHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,13 @@ export const useActionDataHandler = (): {
if (Array.isArray(fieldArr)) {
data.parameters.fields = fieldArr.map((item) => {
const ret = item
;['value', 'isint', 'isbinary'].forEach((key) => {
if (/^(true|false)$/i.test(item[key])) {
ret[key] = /^true/i.test(item[key])
}
})
if (NUM_REG.test(item.value)) {
ret.value = Number(item.value)
} else if (/^(true|false)$/i.test(item.value)) {
ret.value = /^true/i.test(item.value)
}
return ret
})
Expand Down

0 comments on commit c4d28ca

Please sign in to comment.