The last thing we need to do on the note page is allowing users to delete their note. We have the button all set up already. All that needs to be done is to hook it up with the API.

Replace our handleDelete function in src/containers/Notes.js.

function deleteNote() {
  return API.del("notes", `/notes/${}`);

async function handleDelete(event) {

  const confirmed = window.confirm(
    "Are you sure you want to delete this note?"

  if (!confirmed) {


  try {
    await deleteNote();
  } catch (e) {

We are simply making a DELETE request to /notes/:id where we get the id from We use the API.del method from AWS Amplify to do so. This calls our delete API and we redirect to the homepage on success.

Now if you switch over to your browser and try deleting a note you should see it confirm your action and then delete the note.

Note page deleting screenshot

Again, you might have noticed that we are not deleting the attachment when we are deleting a note. We are leaving that up to you to keep things simple. Check the AWS Amplify API Docs on how to a delete file from S3.

Next, let’s add a settings page to our app. This is where a user will be able to pay for our service!