before register back btn debug

main
alireza khaji 3 years ago
parent 0cc6644633
commit 64300df701
  1. 3
      src/redux/reducers/file.js
  2. 2
      src/redux/reducers/user.js
  3. 19
      src/view/register/index.js

@ -1,3 +1,5 @@
import { toast } from "react-toastify";
const initialState = {
loading: false,
error: null,
@ -19,6 +21,7 @@ export default function file(state = initialState, action) {
case "file/loading":
return { ...state, loading: true };
case "file/error":
toast.error(data.message);
return { ...state, loading: false, error: data.message };
default:
return state;

@ -69,7 +69,7 @@ export default function user(state = initialState, action) {
return { ...state, loading: false, userRoles: data, error: null };
case "user/setProfile":
toast.success("تغییرات اعمال شد.");
// window.location.replace("/services");
window.location.replace("/services");
return { ...state, loading: false, error: null, setDone: true };
case "loading":
return { ...state, loading: true };

@ -55,6 +55,7 @@ const Register = ({
getRulse({ id: localStorage.getItem("termId") });
}, []);
console.log("termInfo:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
console.log(termInfo);
useEffect(() => {
@ -414,7 +415,7 @@ const Register = ({
toast.warning("لطفا کد ملی خود را وارد کنید");
} else if (!userInfo.gender) {
toast.warning("لطفا جنسیت خود را مشخص کنید");
} else if (!files.personalPic && !files.shenasNameh) {
} else if ((!files.personalPic && !files.shenasNameh)) {
toast.warning("لطفا عکس شناسنامه و عکس پرسنلی خود را وارد کنید");
} else {
setSteps(1);
@ -595,7 +596,11 @@ const Register = ({
className="bg-white border border-solid border-gray-200 w-52 px-3 mx-1 rounded text-black outline-red52 py-1 h-12 mt-6"
>
{genders.map((item) => (
<option key={`gender${item.id}`} value={item.id}>
<option
key={`gender${item.id}`}
value={item.id}
selected={item.id === userInfo?.gender}
>
{item.title}
</option>
))}
@ -641,7 +646,11 @@ const Register = ({
>
<option value={null}>انتخاب پایه تحصیلی</option>
{grades.map((item) => (
<option key={`Grade__${item.id}`} value={item.id}>
<option
key={`Grade__${item.id}`}
value={item.id}
selected={item.id === Number(userInfo?.gradeIds)}
>
{item.title}
</option>
))}
@ -1261,9 +1270,7 @@ const Register = ({
</p>
</div>
<div className="text-gray-500 text-justify">
{termInfo}
</div>
<div className="text-gray-500 text-justify">{termInfo}</div>
</div>
<div className="flex items-center px-10 py-6">
{/* <input type="checkbox" className="w-6 h-6" />*/}

Loading…
Cancel
Save