From fc8c3bbc73e50fbac3aab751130786e60fa9950f Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 8 Aug 2025 23:26:27 +0100 Subject: Update getForm to return form with ancillary data --- src/api/forms.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/api/forms.ts b/src/api/forms.ts index 77fbb8e..0721dcf 100644 --- a/src/api/forms.ts +++ b/src/api/forms.ts @@ -20,6 +20,20 @@ export interface Form { submitted_text: string | null } +export interface Precheck { + severity: "warning" | "danger" | "secondary", + message: string +} + +export interface SubmissionPrecheck { + can_submit: boolean, + problems: Array +} + +export interface FormWithAncillaryData extends Form { + submission_precheck: SubmissionPrecheck +} + export interface WebHook { url: string, message: string | null @@ -30,7 +44,7 @@ export async function getForms(): Promise { return fetch_response.data; } -export async function getForm(id: string): Promise
{ +export async function getForm(id: string): Promise { const fetch_response = await ApiClient.get(`forms/${id}`); return fetch_response.data; } -- cgit v1.2.3