1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-28 01:29:44 +02:00

fix: Subscribe only when needed

This commit is contained in:
Maksim Eltyshev 2023-01-05 15:03:06 +01:00
parent b955e933b2
commit 58eda7d555
10 changed files with 28 additions and 23 deletions

View file

@ -11,15 +11,17 @@ const createBoard = (projectId, data, headers) =>
const createBoardWithImport = (projectId, data, requestId, headers) =>
http.post(`/projects/${projectId}/boards?requestId=${requestId}`, data, headers);
const getBoard = (id, headers) =>
socket.get(`/boards/${id}`, undefined, headers).then((body) => ({
...body,
included: {
...body.included,
cards: body.included.cards.map(transformCard),
attachments: body.included.attachments.map(transformAttachment),
},
}));
const getBoard = (id, subscribe, headers) =>
socket
.get(`/boards/${id}${subscribe ? '?subscribe=true' : ''}`, undefined, headers)
.then((body) => ({
...body,
included: {
...body.included,
cards: body.included.cards.map(transformCard),
attachments: body.included.attachments.map(transformAttachment),
},
}));
const updateBoard = (id, data, headers) => socket.patch(`/boards/${id}`, data, headers);

View file

@ -9,7 +9,8 @@ const createUser = (data, headers) => socket.post('/users', data, headers);
const getUser = (id, headers) => socket.get(`/users/${id}`, undefined, headers);
const getCurrentUser = (headers) => socket.get('/users/me', undefined, headers);
const getCurrentUser = (subscribe, headers) =>
socket.get(`/users/me${subscribe ? '?subscribe=true' : ''}`, undefined, headers);
const updateUser = (id, data, headers) => socket.patch(`/users/${id}`, data, headers);