1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-26 16:49:45 +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);