Im trying to get the model User
which have a relation with Projects
.
Here is my models/user.js
*fetchUser({ payload, callback }, { call, put }) {
const user = yield call(queryUser, payload);
yield put({
type: 'setCurrentUser',
payload: user,
});
if (callback) callback();
},
What is the best practice? Where should I call the function queryProjects
?
Maybe below this line?
const user = yield call(queryUser, payload);
const projects = yield call(queryProjects, user); // new api call