How to use the @aws-amplify/api.del function in @aws-amplify/api

To help you get started, we’ve selected a few @aws-amplify/api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awslabs / aws-full-stack-template / assets / src / modules / goal / AddEditGoal.tsx View on Github external
handleDelete = (event: any) => {
    this.setState({
      isDeleting: true,
    })

    return API.del("goals", `/goals/${this.props.match.params.id}`, null).then((value: any) => {
      this.setState({
        isDeleting: false,
        showDeleteModal: false,
        redirect: '/'
      });
    });

  }
github TreeHacks / root / src / Rooms / Rooms.tsx View on Github external
onCancel() {
    if (!window.confirm('just making sure—are you sure you\'d like to drop this room? thanks for being so considerate and giving other hackers a chance!')) { return; }

    API.del("treehacks", `/rooms`, {})
      .then(this._updateFromApi)
      .catch(e => alert(`Couldn't drop room: ${e.response.data.message}`));
  }