From 20273b07ad0cd1ba7d9797a91c50980054bd41ca Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 2 Mar 2024 14:00:58 -0800 Subject: [PATCH] Properly type validation errors/warnings --- frontend/src/typings/pending.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/typings/pending.ts b/frontend/src/typings/pending.ts index 53e885bcb..5cdcbc003 100644 --- a/frontend/src/typings/pending.ts +++ b/frontend/src/typings/pending.ts @@ -1,7 +1,21 @@ +export interface ValidationFailure { + propertyName: string; + errorMessage: string; + severity: 'error' | 'warning'; +} + +export interface ValidationError extends ValidationFailure { + isWarning: false; +} + +export interface ValidationWarning extends ValidationFailure { + isWarning: true; +} + export interface Pending { value: T; - errors: any[]; - warnings: any[]; + errors: ValidationError[]; + warnings: ValidationWarning[]; } export type PendingSection = {