addUser.js
1.7 KB
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
71
72
73
74
75
76
77
import { notifyError } from '../services/app.js';
import { addUser,Dictionaries,PremiumPaymentPeriod ,sendMaster,isFollow} from '../services/addUser';
export default {
namespace: 'addUser',
state: {
},
effects: {
*addUser({ payload,callback,error}, { call, put }) {
const { data } = yield call(addUser, payload);
if (data.status) {
if (callback) callback(data);
} else {
// if (error) callback(error);
if (error) error(data);
}
},
*Dictionaries({ payload, callback }, { call, put }) {
const { data } = yield call(Dictionaries, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
*PremiumPaymentPeriod({ payload, callback }, { call, put }) {
console.log(payload);
const { data } = yield call(PremiumPaymentPeriod, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
notifyError(data.message);
}
},
*sendMaster({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(sendMaster, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
// notifyError(data.message);
}
},
*isFollow({ payload, callback,error }, { call, put }) {
console.log(payload);
const { data } = yield call(isFollow, payload);
if (data.status) {
if (callback) callback(data.data);
} else {
if (error) error(data.data);
// notifyError(data.message);
}
},
},
reducers: {
},
subscriptions: {
},
};