mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
chore(web): new lint setup (#30020)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import { useState } from 'react'
|
||||
import { useDebounceFn } from 'ahooks'
|
||||
import type { DebouncedFunc } from 'lodash-es'
|
||||
import type { ValidateCallback, ValidatedStatusState, ValidateValue } from './declarations'
|
||||
import { useDebounceFn } from 'ahooks'
|
||||
import { useState } from 'react'
|
||||
import { ValidatedStatus } from './declarations'
|
||||
import type { ValidateCallback, ValidateValue, ValidatedStatusState } from './declarations'
|
||||
|
||||
export const useValidate: (value: ValidateValue) => [DebouncedFunc<(validateCallback: ValidateCallback) => Promise<void>>, boolean, ValidatedStatusState] = (value) => {
|
||||
const [validating, setValidating] = useState(false)
|
||||
@ -21,7 +21,8 @@ export const useValidate: (value: ValidateValue) => [DebouncedFunc<(validateCall
|
||||
setValidatedStatus(
|
||||
res.status === 'success'
|
||||
? { status: ValidatedStatus.Success }
|
||||
: { status: ValidatedStatus.Error, message: res.message })
|
||||
: { status: ValidatedStatus.Error, message: res.message },
|
||||
)
|
||||
|
||||
setValidating(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user