aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/forms.ts
blob: a4a4981c98684cb1506baa1f0d35bcbfab4df8bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { Question, QuestionType } from "./question"

export interface AllFormsForm {
    title: string,
    id: string,
    description: string,
    open: boolean
}

export interface Form extends AllFormsForm {
    questions: Array<Question>
}

export function getForms(): AllFormsForm[] {
    return [
        {
            title: "Ban Appeals",
            id: "ban-appeals",
            description: "Appealing bans from the Discord server",
            open: true
        },
        {
            title: "Insights 2020",
            id: "insights-2020",
            description: "Insights about the Python Discord community",
            open: false
        },
        {
            title: "Code Jam 2099 Sign Ups",
            id: "code-jam-2099-sign-up",
            description: "Signing up for Python Discord's millionth code jam!",
            open: false
        }
    ]
}

export function getForm(id: string): Promise<Form> {
    const data: Form = {
        title: "Ban Appeals",
        id: "ban-appeals",
        description: "Appealing bans from the Discord server",
        open: true,
        questions: [
            {
                name: "How Spanish are you?",
                type: QuestionType.Text
            }
        ]
    }
    return new Promise((resolve) => {
        setTimeout(() => resolve(data), 1500)
    })
}