mirror of
https://github.com/plankanban/planka.git
synced 2025-07-30 10:39:46 +02:00
Update dependencies
This commit is contained in:
parent
05adea1afd
commit
de61d94a98
145 changed files with 963 additions and 1149 deletions
|
@ -2,7 +2,7 @@ import socket from './socket';
|
|||
|
||||
/* Transformers */
|
||||
|
||||
export const transformAction = action => ({
|
||||
export const transformAction = (action) => ({
|
||||
...action,
|
||||
createdAt: new Date(action.createdAt),
|
||||
});
|
||||
|
@ -10,14 +10,14 @@ export const transformAction = action => ({
|
|||
/* Actions */
|
||||
|
||||
const getActions = (cardId, data, headers) =>
|
||||
socket.get(`/cards/${cardId}/actions`, data, headers).then(body => ({
|
||||
socket.get(`/cards/${cardId}/actions`, data, headers).then((body) => ({
|
||||
...body,
|
||||
items: body.items.map(transformAction),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleActionCreate = next => body => {
|
||||
const makeHandleActionCreate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
|
|
|
@ -7,7 +7,7 @@ const createBoard = (projectId, data, headers) =>
|
|||
socket.post(`/projects/${projectId}/boards`, data, headers);
|
||||
|
||||
const getBoard = (id, headers) =>
|
||||
socket.get(`/boards/${id}`, undefined, headers).then(body => ({
|
||||
socket.get(`/boards/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
|
|
|
@ -2,7 +2,7 @@ import socket from './socket';
|
|||
|
||||
/* Transformers */
|
||||
|
||||
export const transformCard = card => ({
|
||||
export const transformCard = (card) => ({
|
||||
...card,
|
||||
...(card.dueDate && {
|
||||
dueDate: new Date(card.dueDate),
|
||||
|
@ -17,7 +17,7 @@ export const transformCard = card => ({
|
|||
}),
|
||||
});
|
||||
|
||||
export const transformCardData = data => ({
|
||||
export const transformCardData = (data) => ({
|
||||
...data,
|
||||
...(data.dueDate && {
|
||||
dueDate: data.dueDate.toISOString(),
|
||||
|
@ -35,32 +35,32 @@ export const transformCardData = data => ({
|
|||
/* Actions */
|
||||
|
||||
const createCard = (listId, data, headers) =>
|
||||
socket.post(`/lists/${listId}/cards`, transformCardData(data), headers).then(body => ({
|
||||
socket.post(`/lists/${listId}/cards`, transformCardData(data), headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const getCard = (id, headers) =>
|
||||
socket.get(`/cards/${id}`, undefined, headers).then(body => ({
|
||||
socket.get(`/cards/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const updateCard = (id, data, headers) =>
|
||||
socket.patch(`/cards/${id}`, transformCardData(data), headers).then(body => ({
|
||||
socket.patch(`/cards/${id}`, transformCardData(data), headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
const deleteCard = (id, headers) =>
|
||||
socket.delete(`/cards/${id}`, undefined, headers).then(body => ({
|
||||
socket.delete(`/cards/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
}));
|
||||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleCardCreate = next => body => {
|
||||
const makeHandleCardCreate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
item: transformCard(body.item),
|
||||
|
|
|
@ -4,19 +4,19 @@ import { transformAction } from './actions';
|
|||
/* Actions */
|
||||
|
||||
const createCommentAction = (cardId, data, headers) =>
|
||||
socket.post(`/cards/${cardId}/comment-actions`, data, headers).then(body => ({
|
||||
socket.post(`/cards/${cardId}/comment-actions`, data, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const updateCommentAction = (id, data, headers) =>
|
||||
socket.patch(`/comment-actions/${id}`, data, headers).then(body => ({
|
||||
socket.patch(`/comment-actions/${id}`, data, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
||||
const deleteCommentAction = (id, headers) =>
|
||||
socket.delete(`/comment-actions/${id}`, undefined, headers).then(body => ({
|
||||
socket.delete(`/comment-actions/${id}`, undefined, headers).then((body) => ({
|
||||
...body,
|
||||
item: transformAction(body.item),
|
||||
}));
|
||||
|
|
|
@ -5,7 +5,7 @@ import Config from '../constants/Config';
|
|||
const http = {};
|
||||
|
||||
// TODO: all methods
|
||||
['POST'].forEach(method => {
|
||||
['POST'].forEach((method) => {
|
||||
http[method.toLowerCase()] = (url, data, headers) => {
|
||||
const formData = Object.keys(data).reduce((result, key) => {
|
||||
result.append(key, data[key]);
|
||||
|
@ -18,8 +18,8 @@ const http = {};
|
|||
headers,
|
||||
body: formData,
|
||||
})
|
||||
.then(response =>
|
||||
response.json().then(body => ({
|
||||
.then((response) =>
|
||||
response.json().then((body) => ({
|
||||
body,
|
||||
isError: response.status !== 200,
|
||||
})),
|
||||
|
|
|
@ -4,8 +4,8 @@ import { transformAction } from './actions';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const getNotifications = headers =>
|
||||
socket.get('/notifications', undefined, headers).then(body => ({
|
||||
const getNotifications = (headers) =>
|
||||
socket.get('/notifications', undefined, headers).then((body) => ({
|
||||
...body,
|
||||
included: {
|
||||
...body.included,
|
||||
|
@ -19,7 +19,7 @@ const updateNotifications = (ids, data, headers) =>
|
|||
|
||||
/* Event handlers */
|
||||
|
||||
const makeHandleNotificationCreate = next => body => {
|
||||
const makeHandleNotificationCreate = (next) => (body) => {
|
||||
next({
|
||||
...body,
|
||||
included: {
|
||||
|
|
|
@ -2,7 +2,7 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const getProjects = headers => socket.get('/projects', undefined, headers);
|
||||
const getProjects = (headers) => socket.get('/projects', undefined, headers);
|
||||
|
||||
const createProject = (data, headers) => socket.post('/projects', data, headers);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ const { socket } = io;
|
|||
|
||||
socket.connect = socket._connect; // eslint-disable-line no-underscore-dangle
|
||||
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach(method => {
|
||||
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].forEach((method) => {
|
||||
socket[method.toLowerCase()] = (url, data, headers) =>
|
||||
new Promise((resolve, reject) => {
|
||||
socket.request(
|
||||
|
|
|
@ -3,11 +3,11 @@ import socket from './socket';
|
|||
|
||||
/* Actions */
|
||||
|
||||
const getUsers = headers => socket.get('/users', undefined, headers);
|
||||
const getUsers = (headers) => socket.get('/users', undefined, headers);
|
||||
|
||||
const createUser = (data, headers) => socket.post('/users', data, headers);
|
||||
|
||||
const getCurrentUser = headers => socket.get('/users/me', undefined, headers);
|
||||
const getCurrentUser = (headers) => socket.get('/users/me', undefined, headers);
|
||||
|
||||
const updateUser = (id, data, headers) => socket.patch(`/users/${id}`, data, headers);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue