mirror of
https://github.com/joinmarket-webui/jam.git
synced 2026-08-16 13:01:05 +02:00
fix: maxCjFeeRelInPercent validation
This commit is contained in:
parent
3cf02afd16
commit
fd819cf8ca
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import type { TFunction } from 'i18next'
|
||||
import * as yup from 'yup'
|
||||
import { CJ_FEE_ABS_MAX, CJ_FEE_ABS_MIN, CJ_FEE_REL_MAX, CJ_FEE_REL_MIN } from '@/constants/jam'
|
||||
import { factorToPercentage, formatSats, isValidInteger } from '@/lib/utils'
|
||||
import { factorToPercentage, formatSats, isValidInteger, isValidNumber } from '@/lib/utils'
|
||||
import type { AmountSats } from '@/types/global'
|
||||
|
||||
export type CollaboratorFeesFormValues = {
|
||||
|
|
@ -34,7 +34,7 @@ export function createCollaboratorFeesFormSchema({
|
|||
.required(maxCjFeeAbsoluteMessage),
|
||||
maxCjFeeRelInPercent: yup
|
||||
.number()
|
||||
.transform((value) => (isValidInteger(value) ? value : null))
|
||||
.transform((value) => (isValidNumber(value) ? value : null))
|
||||
.min(factorToPercentage(CJ_FEE_REL_MIN), maxCjFeeRelativeMessage)
|
||||
.max(factorToPercentage(CJ_FEE_REL_MAX), maxCjFeeRelativeMessage)
|
||||
.required(maxCjFeeRelativeMessage),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue