diff --git a/assetsTransformer.js b/assetsTransformer.js index 5eadded..7f8711f 100644 --- a/assetsTransformer.js +++ b/assetsTransformer.js @@ -2,6 +2,6 @@ const path = require('path'); module.exports = { process(src, filename, config, options) { - return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';'; + return `module.exports = ${JSON.stringify(path.basename(filename))};`; }, }; diff --git a/client/actions/groups.js b/client/actions/groups.js index d68f1cb..d6220a1 100644 --- a/client/actions/groups.js +++ b/client/actions/groups.js @@ -1,7 +1,7 @@ /* global localStorage */ import axios from 'axios'; import { - LIST_GROUPS, ADD_USER_TO_GROUP, GET_GROUP_USERS, LIST_ALL_USERS, LIST_GROUP } + LIST_GROUPS, ADD_USER_TO_GROUP, GET_GROUP_USERS, LIST_GROUP } from './types'; import attachAuthorizationToken from '../utils/attachAuthorizationToken'; @@ -86,14 +86,28 @@ export const listAllUsers = groupId => dispatch => }); /** - * api call to addMemberToGroup + * api call to joinGroup * @param {object} groupId * @return {object} returns newGroup if the call is successful */ -export const addMemberToGroup = groupId => +export const joinGroup = groupId => dispatch => axios.post(`/api/v1/group/${groupId}/user`) .then((response) => { dispatch(addUser(response.data.newGroup)); }).catch((error) => { throw (error); }); + +/** + * api call to addMemberToGroup + * @param {object} groupId + * @return {object} returns newGroup if the call is successful + */ +export const addMemberToGroup = (groupId, userId) => + dispatch => axios.post(`/api/v1/group/${groupId}/user/${userId}`) + .then((response) => { + dispatch(addUser(response.data.newGroup)); + }).catch((error) => { + throw (error); + }); + diff --git a/client/components/Group/GroupCard.jsx b/client/components/Group/GroupCard.jsx index bbc5b17..c309b56 100644 --- a/client/components/Group/GroupCard.jsx +++ b/client/components/Group/GroupCard.jsx @@ -19,7 +19,7 @@ class GroupCard extends Component { } /* eslint-enable */ render() { - const { groupName, id, joinGroup, listUsers, users } = this.props; + const { groupName, id, joinAGroup, listUsers, users } = this.props; return (
USERNAME | +|
---|---|
+ + add_box + + {user.username} + | +{user.email} | +
If you did not request this, please ignore this mail and your password will remain unchanged.