Skip to content

Commit fc8c3bb

Browse files
committed
Update getForm to return form with ancillary data
1 parent 5b8c07e commit fc8c3bb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/api/forms.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ export interface Form {
2020
submitted_text: string | null
2121
}
2222

23+
export interface Precheck {
24+
severity: "warning" | "danger" | "secondary",
25+
message: string
26+
}
27+
28+
export interface SubmissionPrecheck {
29+
can_submit: boolean,
30+
problems: Array<Precheck>
31+
}
32+
33+
export interface FormWithAncillaryData extends Form {
34+
submission_precheck: SubmissionPrecheck
35+
}
36+
2337
export interface WebHook {
2438
url: string,
2539
message: string | null
@@ -30,7 +44,7 @@ export async function getForms(): Promise<Form[]> {
3044
return fetch_response.data;
3145
}
3246

33-
export async function getForm(id: string): Promise<Form> {
47+
export async function getForm(id: string): Promise<FormWithAncillaryData> {
3448
const fetch_response = await ApiClient.get(`forms/${id}`);
3549
return fetch_response.data;
3650
}

0 commit comments

Comments
 (0)