You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.9 KiB
63 lines
1.9 KiB
import proxy from "../proxy"; |
|
|
|
const user = { |
|
otp: (data = {}) => async (dispatch) => |
|
await proxy.post("public/sendOTP", data, { dispatch }), |
|
|
|
otp_login: (data) => async (dispatch) => |
|
await proxy.login("user/otp/login", data, { dispatch }), //{cellphone, otp} |
|
|
|
login: (data) => async (dispatch) => |
|
await proxy.login("user/login", data, { dispatch }), |
|
|
|
// register: (data : undefined) => async (dispatch : Dispatch) => |
|
// await proxy.login("user/register", data, { dispatch }), |
|
|
|
// switchRole: (data : String) => async (dispatch : Dispatch) => |
|
// await proxy.login("user/switchRole", data, { dispatch }), |
|
|
|
logout: (data) => async (dispatch) => |
|
await proxy.logout("user/logout", data, { dispatch }), |
|
|
|
getUserRole: (data) => async (dispatch) => |
|
await proxy.get("user/getUserRole", data, { dispatch }), |
|
|
|
// list: |
|
// (data = {}) => |
|
// async (dispatch : Dispatch) => |
|
// await proxy.get("user/list", data, { dispatch }), |
|
// domains: |
|
// (data = {}) => |
|
// async (dispatch : Dispatch) => |
|
// await proxy.get("user/domains", data, { dispatch }), |
|
// getmothers: |
|
// (data = {}) => |
|
// async (dispatch : Dispatch) => |
|
// await proxy.get("mothers/list", data, { |
|
// dispatch, |
|
// }), |
|
getProfile: |
|
(data = {}) => |
|
async (dispatch) => |
|
await proxy.get("user/getProfile", data, { dispatch }), |
|
setProfile: |
|
(data = {}, data2 = {}) => |
|
async (dispatch) => { |
|
await proxy.put("user/setProfile", data, { dispatch }); |
|
await proxy.get("user/getProfile", data2, { dispatch }); |
|
}, |
|
add: |
|
(data = {}, data2 = {}) => |
|
async (dispatch) => { |
|
await proxy.post("user/add", data); |
|
await proxy.get("user/list", data2, { dispatch }); |
|
}, |
|
del: |
|
(data = {}, data2 = {}) => |
|
async (dispatch) => { |
|
await proxy.delete("user/delete", data); |
|
await proxy.get("user/list", data2, { dispatch }); |
|
}, |
|
}; |
|
|
|
export default user;
|
|
|