-
Notifications
You must be signed in to change notification settings - Fork 1
/
actions.js
70 lines (61 loc) · 1.57 KB
/
actions.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
export const actionTypes = {
FAILURE: 'FAILURE',
ADD_CORRECT_QUESTION: 'ADD_CORRECT_QUESTION',
RESET_CORRECT_QUESTIONS: 'RESET_CORRECT_QUESTIONS',
CREATE_INVOICE: 'CREATE_INVOICE',
REPLACE_INVOICE_STATUS: 'REPLACE_INVOICE_STATUS',
START_RT_CHECK_INVOICE_STATUS: 'START_RT_CHECK_INVOICE_STATUS',
STOP_RT_CHECK_INVOICE_STATUS: 'STOP_RT_CHECK_INVOICE_STATUS',
CREATE_FUNDED_QUIZ: 'CREATE_FUNDED_QUIZ',
REPLACE_FUNDED_QUIZ: 'REPLACE_FUNDED_QUIZ'
};
export function startRealtimeInvoiceStatus(data) {
return {
type: actionTypes.START_RT_CHECK_INVOICE_STATUS,
payload: data
};
}
export function stopRealtimeInvoiceStatus() {
return {
type: actionTypes.STOP_RT_CHECK_INVOICE_STATUS
};
}
export function createInvoice(data) {
return {
type: actionTypes.CREATE_INVOICE,
payload: data
};
}
export function replaceInvoiceStatus(data) {
return {
type: actionTypes.REPLACE_INVOICE_STATUS,
data
};
}
export function createFundedQuiz(data) {
return {
type: actionTypes.CREATE_FUNDED_QUIZ,
payload: data
};
}
export function replaceFundedQuiz(data) {
return {
type: actionTypes.REPLACE_FUNDED_QUIZ,
data
};
}
export function addCorrectQuestion(data) {
return {
type: actionTypes.ADD_CORRECT_QUESTION,
data,
}
}
export function resetCorrectQuestions() {
return { type: actionTypes.RESET_CORRECT_QUESTIONS }
}
export function failure(error) {
return {
type: actionTypes.FAILURE,
error,
}
}