MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / fetchCurrent

Function fetchCurrent

src/models/user.js:18–30  ·  view source on GitHub ↗
(data, { call, put })

Source from the content-addressed store, hash-verified

16 effects: {
17
18 *fetchCurrent (data, { call, put }) {
19 let { token, siteCode } = data.query || {};
20 token = token || getCookie('token');
21 siteCode = siteCode || getCookie('siteCode');
22
23 if (token && siteCode) {
24 const response = yield call(loginByToken, token, siteCode);
25 yield put({
26 type: 'saveCurrentUser',
27 payload: response,
28 });
29 }
30 },
31 },
32 reducers: {
33 saveCurrentUser (state, action) {

Callers

nothing calls this directly

Calls 1

getCookieFunction · 0.90

Tested by

no test coverage detected