1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-24 15:49:46 +02:00

ref: Refactoring

This commit is contained in:
Maksim Eltyshev 2022-08-04 13:31:14 +02:00
parent aa4723d7fe
commit 3f8216dca8
189 changed files with 3781 additions and 3486 deletions

View file

@ -1,22 +1,27 @@
import { call, put } from 'redux-saga/effects';
import { authenticate, clearAuthenticateError } from '../../../actions';
import actions from '../../../actions';
import api from '../../../api';
export function* authenticateService(data) {
yield put(authenticate(data));
export function* authenticate(data) {
yield put(actions.authenticate(data));
let accessToken;
try {
({ item: accessToken } = yield call(api.createAccessToken, data));
} catch (error) {
yield put(authenticate.failure(error));
yield put(actions.authenticate.failure(error));
return;
}
yield put(authenticate.success(accessToken));
yield put(actions.authenticate.success(accessToken));
}
export function* clearAuthenticateErrorService() {
yield put(clearAuthenticateError());
export function* clearAuthenticateError() {
yield put(actions.clearAuthenticateError());
}
export default {
authenticate,
clearAuthenticateError,
};