{"size": 893, "ext": "js", "max_stars_repo_path": "src/models/assess-my.js", "max_stars_repo_name": "pole-org/sys", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/models/assess-my.js", "max_issues_repo_name": "pole-org/sys", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/models/assess-my.js", "max_forks_repo_name": "pole-org/sys", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.8055555556, "max_line_length": 86, "alphanum_fraction": 0.5733482643}
import {createModel} from '../utils/rs/Model';
import {getMyAssess, update, updateEmployee, updateManager} from '../services/assess';

export default createModel({
  namespace: 'assess-my',
  initialState: {
    isDepManager: false,
    list: [],
  },
  effects: {
    * getMyAssess({payload}, {call, put}) {
      const res = yield call(getMyAssess, payload);
      if (res.data) {
        const data = res.data.toObject();
        yield put({
          type: 'setStateOk',
          payload: {
            ...data,
          },
        });
      }
    },
    * updateManager({payload}, {call, put}) {
      const res = yield call(updateManager, payload);
      return Promise.resolve({success: res.success});
    },
    * updateEmployee({payload}, {call, put}) {
      const res = yield call(updateEmployee, payload);
      return Promise.resolve({success: res.success});
    },
  },
});



