Combine API props, update tests for redux hooks

This commit is contained in:
Nathan Barber
2021-04-08 18:28:49 -04:00
parent 21f4988f24
commit 51deaa36f3
18 changed files with 347 additions and 222 deletions

View File

@@ -81,16 +81,4 @@ CreateGroup.propTypes = {
}),
};
const withGroupsAPI = withProps((props) => ({
createGroup: (groupName) => jhapiRequest("/groups/" + groupName, "POST"),
failRegexEvent: () =>
alert(
"Removed " +
JSON.stringify(removed_users) +
" for either containing special characters or being too short."
),
refreshGroupsData: () =>
jhapiRequest("/groups", "GET").then((data) => data.json()),
}));
export default compose(withGroupsAPI)(CreateGroup);
export default CreateGroup;