diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/api/forms.ts | 29 | 
1 files changed, 7 insertions, 22 deletions
| diff --git a/src/api/forms.ts b/src/api/forms.ts index 3869838..8c31e5b 100644 --- a/src/api/forms.ts +++ b/src/api/forms.ts @@ -1,4 +1,4 @@ -import { Question, QuestionType } from "./question"; +import { Question } from "./question";  import ApiClient from "./client";  export enum FormFeatures { @@ -25,26 +25,11 @@ export interface WebHook {  }  export async function getForms(): Promise<Form[]> { -    const resp = await ApiClient.get("forms/discoverable"); -    return resp.data; +    const fetch_response = await ApiClient.get("forms/discoverable"); +    return fetch_response.data;  } -export function getForm(id: string): Promise<Form> { -    const data: Form = { -        name: "Ban Appeals", -        id: "ban-appeals", -        description: "Appealing bans from the Discord server", -        features: [FormFeatures.Discoverable, FormFeatures.Open], -        questions: [ -            { -                id: "how-spanish-are-you", -                name: "How Spanish are you?", -                type: QuestionType.ShortText, -                data: {} -            } -        ] -    }; -    return new Promise((resolve) => { -        setTimeout(() => resolve(data), 1500); -    }); -}  +export async function getForm(id: string): Promise<Form> { +    const fetch_response = await ApiClient.get(`forms/${id}`); +    return fetch_response.data; +} | 
