--- a/client/src/sagas/index.js Mon Jun 19 18:23:26 2017 +0200
+++ b/client/src/sagas/index.js Mon Jun 19 18:32:27 2017 +0200
@@ -100,7 +100,7 @@
try {
const { username, password } = yield take(types.AUTH_LOGIN_REQUEST);
- const client = context['client'];
+ const client = context.client;
const response = yield client.post('/api/auth/login/', { username, password });
localStorage.setItem('currentUser', JSON.stringify(response.user));
@@ -135,9 +135,10 @@
}
}
-function* watchUpdateSettings() {
+function* watchUpdateSettings(context) {
while (true) {
const { username, firstname, lastname } = yield take(types.USER_UPDATE_SETTINGS_ASYNC);
+ const client = context.client;
try {
yield client.put('/api/auth/user/', {
username,
@@ -163,6 +164,6 @@
watchLoginSubmit(),
watchLoginRequest(context),
watchStoreToken(),
- watchUpdateSettings(),
+ watchUpdateSettings(context),
])
}