Skip to content

Instantly share code, notes, and snippets.

@susimsek
Created March 14, 2022 20:17
Show Gist options
  • Select an option

  • Save susimsek/19f526f15f2af7d7aff6bbcd458bdf37 to your computer and use it in GitHub Desktop.

Select an option

Save susimsek/19f526f15f2af7d7aff6bbcd458bdf37 to your computer and use it in GitHub Desktop.
Hateoas Capability Component
const {postLink} = useSelector((store) => ({
postLink: store.capability.links.capabilities.href
}));
const onSubmit = async e => {
e.preventDefault();
const newCapability = {
techStack,
numOfDevelopers,
numOfAvailableDevelopers
};
try {
let response = Promise.resolve(dispatch(addCapabilityHandler(newCapability, postLink)));
await response;
closeModal();
} catch (error) {
dispatch(getErrors(error.response.data));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment