mirror of
https://github.com/plankanban/planka.git
synced 2025-12-21 09:15:51 +03:00
Initial commit
This commit is contained in:
31
client/src/api/users.js
Executable file
31
client/src/api/users.js
Executable file
@@ -0,0 +1,31 @@
|
||||
import http from './http';
|
||||
import socket from './socket';
|
||||
|
||||
/* Actions */
|
||||
|
||||
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 updateUser = (id, data, headers) => socket.patch(`/users/${id}`, data, headers);
|
||||
|
||||
const uploadUserAvatar = (id, file, headers) => http.post(
|
||||
`/users/${id}/upload-avatar`,
|
||||
{
|
||||
file,
|
||||
},
|
||||
headers,
|
||||
);
|
||||
|
||||
const deleteUser = (id, headers) => socket.delete(`/users/${id}`, undefined, headers);
|
||||
|
||||
export default {
|
||||
getUsers,
|
||||
createUser,
|
||||
getCurrentUser,
|
||||
updateUser,
|
||||
uploadUserAvatar,
|
||||
deleteUser,
|
||||
};
|
||||
Reference in New Issue
Block a user