Delete data
DELETE requests
To delete an item via the API endpoint:
import { del } from 'aws-amplify/api';
async function deleteItem() { try { const restOperation = del({ apiName: 'myRestApi', path: 'items/1' }); await restOperation.response; console.log('DELETE call succeeded'); } catch (e) { console.log('DELETE call failed: ', JSON.parse(e.response.body)); }}