mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 15:49:46 +02:00
ref: Refactoring
This commit is contained in:
parent
aa4723d7fe
commit
3f8216dca8
189 changed files with 3781 additions and 3486 deletions
|
@ -1,13 +1,12 @@
|
|||
import { call, select } from 'redux-saga/effects';
|
||||
|
||||
import request from '../request';
|
||||
import { pathsMatchSelector } from '../../../selectors';
|
||||
import selectors from '../../../selectors';
|
||||
import api from '../../../api';
|
||||
import Paths from '../../../constants/Paths';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export function* fetchBoardByCurrentPathRequest() {
|
||||
const pathsMatch = yield select(pathsMatchSelector);
|
||||
export function* fetchBoardByCurrentPath() {
|
||||
const pathsMatch = yield select(selectors.selectPathsMatch);
|
||||
|
||||
let board;
|
||||
let card;
|
||||
|
@ -67,3 +66,7 @@ export function* fetchBoardByCurrentPathRequest() {
|
|||
project: projects[0],
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
fetchBoardByCurrentPath,
|
||||
};
|
|
@ -1,12 +1,11 @@
|
|||
import { call } from 'redux-saga/effects';
|
||||
|
||||
import { fetchBoardByCurrentPathRequest } from './board';
|
||||
import { fetchBoardByCurrentPath } from './boards';
|
||||
import request from '../request';
|
||||
import api from '../../../api';
|
||||
import mergeRecords from '../../../utils/merge-records';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export function* fetchCoreRequest() {
|
||||
export function* fetchCore() {
|
||||
const { item: user } = yield call(request, api.getCurrentUser);
|
||||
const { items: users1 } = yield call(request, api.getUsers);
|
||||
|
||||
|
@ -42,7 +41,7 @@ export function* fetchCoreRequest() {
|
|||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
} = yield call(fetchBoardByCurrentPathRequest));
|
||||
} = yield call(fetchBoardByCurrentPath));
|
||||
} catch {} // eslint-disable-line no-empty
|
||||
|
||||
const body = yield call(request, api.getNotifications);
|
||||
|
@ -50,7 +49,7 @@ export function* fetchCoreRequest() {
|
|||
let { items: notifications } = body;
|
||||
|
||||
const {
|
||||
included: { users: users3, cards: cards2, actions },
|
||||
included: { users: users3, cards: cards2, activities },
|
||||
} = body;
|
||||
|
||||
if (card) {
|
||||
|
@ -80,7 +79,7 @@ export function* fetchCoreRequest() {
|
|||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
actions,
|
||||
activities,
|
||||
notifications,
|
||||
users: mergeRecords(users1, users2, users3),
|
||||
projects: mergeRecords(projects1, projects2),
|
||||
|
@ -88,3 +87,7 @@ export function* fetchCoreRequest() {
|
|||
cards: mergeRecords(cards1, cards2),
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
fetchCore,
|
||||
};
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
export * from './core';
|
||||
export * from './board';
|
||||
import core from './core';
|
||||
import boards from './boards';
|
||||
|
||||
export default {
|
||||
...core,
|
||||
...boards,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue