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.
44 lines
1.4 KiB
44 lines
1.4 KiB
import proxy from "../proxy"; |
|
const book = { |
|
list: |
|
(data = {}) => |
|
async (dispatch) => |
|
await proxy.get("book/list", data, { dispatch }), |
|
info: |
|
(data = {}) => |
|
async (dispatch) => |
|
await proxy.get("book/info", data, { dispatch }), |
|
setLessonActive: (data) => async (dispatch) => |
|
await dispatch({ type: "book/lesson/active", data: data }), |
|
gradeFilter: (data) => async (dispatch) => |
|
await dispatch({ type: "book/gradeFilter", data: data }), |
|
sortFilter: (data) => async (dispatch) => |
|
await dispatch({ type: "book/sortFilter", data: data }), |
|
setFilterOptions: (data) => async (dispatch) => { |
|
dispatch({ type: "book/setFilterOptions", data: data }) |
|
} |
|
// update: |
|
// (data = {}, data2 = {}) => |
|
// async (dispatch : Dispatch) => { |
|
// await proxy.put("book/update", data); |
|
// await proxy.get("book/list", data2, { dispatch }); |
|
// }, |
|
// add: |
|
// (data = {}, data2 = {}) => |
|
// async (dispatch) => { |
|
// await proxy.post("book/add", data); |
|
// await proxy.get("book/list", data2, { dispatch }); |
|
// }, |
|
// del: |
|
// (data = {}, data2 = {}) => |
|
// async (dispatch) => { |
|
// await proxy.delete("book/delete", data); |
|
// await proxy.get("book/list", data2, { dispatch }); |
|
// }, |
|
// searchBook: (data) => async (dispatch) => { |
|
// dispatch({ type: "book/search", data: data }); |
|
// }, |
|
|
|
}; |
|
|
|
export default book;
|
|
|