- изменён стиль скроллбаров - fix: изменено назначение пользхователя при создании задачи(не список пользователей, а один)
87 lines
2.7 KiB
JavaScript
87 lines
2.7 KiB
JavaScript
import axios from 'axios';
|
|
|
|
export const loadBoardDataAPI = async (boardId) => {
|
|
return axios.post('/api/boards/load', {id: boardId});
|
|
};
|
|
|
|
export const createTaskAPI = async (taskCateg, taskTitle, taskDescription, taskDedline, memberId) => {
|
|
return axios.post('/api/boards/categories/tasks/create', {
|
|
category_id: taskCateg, title: taskTitle, description: taskDescription, deadline: taskDedline, assigned_user: memberId
|
|
});
|
|
};
|
|
|
|
export const createCategoryAPI = async (boardId, categTitle) => {
|
|
return axios.post('/api/boards/categories/create', {
|
|
board_id: boardId, title: categTitle
|
|
});
|
|
};
|
|
|
|
export const updateTaskAPI = async (editedTaskId, editedTaskMethod, editedTaskValue) => {
|
|
return axios.put('/api/boards/categories/tasks/update', {
|
|
id: editedTaskId, update_method: editedTaskMethod, value: editedTaskValue
|
|
});
|
|
};
|
|
|
|
export const updateCategoryAPI = async (editedCategId, editedCategMethod, editedCategTitle) => {
|
|
return axios.put('/api/boards/categories/update', {
|
|
id: editedCategId, update_method: editedCategMethod, value: editedCategTitle
|
|
});
|
|
};
|
|
|
|
export const deleteCategoryAPI = async (categId) => {
|
|
return axios.delete('/api/boards/categories/delete', {
|
|
data: {id: categId}
|
|
});
|
|
};
|
|
|
|
export const deleteTaskAPI = async (taskId) => {
|
|
return axios.delete('/api/boards/categories/tasks/delete', {
|
|
data: {id: taskId}
|
|
});
|
|
};
|
|
|
|
export const assignMemberAPI = async (editedTaskId, memberId) => {
|
|
return axios.put('/api/boards/categories/tasks/assign', {
|
|
id: editedTaskId, member_id: memberId
|
|
});
|
|
};
|
|
|
|
export const unassignMemberAPI = async (editedTaskId, memberId) => {
|
|
return axios.put('/api/boards/categories/tasks/unassign', {
|
|
id: editedTaskId, member_id: memberId
|
|
});
|
|
};
|
|
|
|
export const addMemberAPI = async (boardId, username) => {
|
|
return axios.post('/api/boards/members/add', {
|
|
username: username, board_id: boardId
|
|
});
|
|
};
|
|
|
|
export const deleteMemberAPI = async (boardId, memberId) => {
|
|
return axios.delete('/api/boards/members/delete', {
|
|
data: {member_id: memberId, board_id: boardId}
|
|
});
|
|
};
|
|
|
|
export const quitMemberAPI = async (boardId) => {
|
|
return axios.delete('/api/boards/members/quit', {
|
|
data: {board_id: boardId}
|
|
});
|
|
};
|
|
|
|
export const updateBoardsAPI = async (editedBoardId, editedBoardMethod, editedBoardValue) => {
|
|
return axios.put('/api/boards/update', {
|
|
id: editedBoardId, update_method: editedBoardMethod, value: editedBoardValue
|
|
});
|
|
};
|
|
|
|
export const deleteBoardsAPI = async (boardId) => {
|
|
return axios.delete('/api/boards/delete', {
|
|
data: {id: boardId}
|
|
});
|
|
};
|
|
|
|
export const meAPI = () => {
|
|
return axios.get('/api/users/me');
|
|
}; |