2020-05-26 00:46:04 +05:00
|
|
|
import http from './http';
|
2019-08-31 04:07:25 +05:00
|
|
|
import socket from './socket';
|
|
|
|
|
|
|
|
/* Actions */
|
|
|
|
|
2020-03-25 00:15:47 +05:00
|
|
|
const getProjects = (headers) => socket.get('/projects', undefined, headers);
|
2019-08-31 04:07:25 +05:00
|
|
|
|
|
|
|
const createProject = (data, headers) => socket.post('/projects', data, headers);
|
|
|
|
|
|
|
|
const updateProject = (id, data, headers) => socket.patch(`/projects/${id}`, data, headers);
|
|
|
|
|
2020-05-26 00:46:04 +05:00
|
|
|
const updateProjectBackgroundImage = (id, data, headers) =>
|
|
|
|
http.post(`/projects/${id}/background-image`, data, headers);
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
const deleteProject = (id, headers) => socket.delete(`/projects/${id}`, undefined, headers);
|
|
|
|
|
|
|
|
export default {
|
|
|
|
getProjects,
|
|
|
|
createProject,
|
|
|
|
updateProject,
|
2020-05-26 00:46:04 +05:00
|
|
|
updateProjectBackgroundImage,
|
2019-08-31 04:07:25 +05:00
|
|
|
deleteProject,
|
|
|
|
};
|