Skip to content

Instantly share code, notes, and snippets.

@SahanAmarsha
Created February 28, 2021 20:50
Show Gist options
  • Save SahanAmarsha/043f254f77309daba09506e8ef940d00 to your computer and use it in GitHub Desktop.
Save SahanAmarsha/043f254f77309daba09506e8ef940d00 to your computer and use it in GitHub Desktop.
submitHandler.js
const submitHandler = async (event) => {
event.preventDefault();
const currentUser = await Auth.currentAuthenticatedUser();
try {
const result = await API.graphql({
query: createUser,
variables: {
input: {
id: currentUser.attributes.sub,
firstName: firstName,
lastName: secondName,
description: "description,"
},
},
});
console.log(result);
} catch (err) {
console.log(err);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment