parent
							
								
									4be4ab6cdb
								
							
						
					
					
						commit
						3d391f7497
					
				
				 30 changed files with 359 additions and 174 deletions
			
			
		@ -0,0 +1,26 @@ | 
				
			||||
import proxy from "../proxy"; | 
				
			||||
const activation = { | 
				
			||||
  list: | 
				
			||||
    (data = {}) => | 
				
			||||
    async (dispatch) => | 
				
			||||
      await proxy.get("activation/list", data, { dispatch }), | 
				
			||||
  update: | 
				
			||||
    (data = {}, data2 = {}) => | 
				
			||||
    async (dispatch) => { | 
				
			||||
      await proxy.put("activation/update", data); | 
				
			||||
      await proxy.get("activation/list", data2, { dispatch }); | 
				
			||||
    }, | 
				
			||||
  add: | 
				
			||||
    (data = {}) => | 
				
			||||
    async (dispatch) => { | 
				
			||||
      await proxy.post("activation/add", data); | 
				
			||||
    }, | 
				
			||||
  del: | 
				
			||||
    (data = {}, data2 = {}) => | 
				
			||||
    async (dispatch) => { | 
				
			||||
      await proxy.delete("activation/delete", data); | 
				
			||||
      await proxy.get("activation/list", data2, { dispatch }); | 
				
			||||
    }, | 
				
			||||
}; | 
				
			||||
 | 
				
			||||
export default activation; | 
				
			||||
@ -0,0 +1,27 @@ | 
				
			||||
import { toast } from "react-toastify"; | 
				
			||||
 | 
				
			||||
const initialState = { | 
				
			||||
  loading: false, | 
				
			||||
  error: null, | 
				
			||||
  list: [], | 
				
			||||
}; | 
				
			||||
export default function activation(state = initialState, action) { | 
				
			||||
  let { type, data } = action; | 
				
			||||
  switch (type) { | 
				
			||||
    case "activation/list": | 
				
			||||
      return { ...state, loading: false, list: data, error: null }; | 
				
			||||
    case "activation/update": | 
				
			||||
      return { ...state, loading: false, error: null }; | 
				
			||||
    case "activation/add": | 
				
			||||
      toast.sucess("کتاب شما با موفقیت فعال گردید."); | 
				
			||||
      return { ...state, loading: false, error: null }; | 
				
			||||
    case "activation/delete": | 
				
			||||
      return { ...state, loading: false, error: null }; | 
				
			||||
    case "loading": | 
				
			||||
      return { ...state, loading: true }; | 
				
			||||
    case "error": | 
				
			||||
      return { ...state, loading: false, error: data.message }; | 
				
			||||
    default: | 
				
			||||
      return state; | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
| 
		 After Width: | Height: | Size: 122 KiB  | 
| 
		 After Width: | Height: | Size: 141 KiB  | 
@ -1,8 +1,8 @@ | 
				
			||||
.MuiBreadcrumbs-li{ | 
				
			||||
.MuiBreadcrumbs-li { | 
				
			||||
  a { | 
				
			||||
    text-decoration: none; | 
				
			||||
    font-family: numeralLight; | 
				
			||||
    color: #6F7074; | 
				
			||||
    color: #6f7074; | 
				
			||||
    letter-spacing: -1px; | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue