feature: RowDialog validates a row as part of a larger value, such as a whole document with the row put in.
Release / release (push) Successful in 29s

This commit is contained in:
slawek committed 2026-10-30 12:38:15 +01:00
1 parent cd6ef1c120
commit 00934a7c0c
6 files changed
+23 -10

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ import { request, type Validation } from './api.ts'
* Asks the server to validate value at path (a .../validate endpoint) 250 ms after it last
* changed. pending is true until the answer for the current value arrives; until then the previous result stays.
*/
export function useValidation<T extends Validation>(path: string | null, value: unknown): { result: T | null; error: string; pending: boolean } {
export function useValidation<T = Validation>(path: string | null, value: unknown): { result: T | null; error: string; pending: boolean } {
const key = path === null ? '' : `${path}\n${JSON.stringify(value)}`
const [answer, setAnswer] = useState<{ key: string; result: T | null; error: string } | null>(null)