Skip to content

Instantly share code, notes, and snippets.

@evankirkiles
Created March 7, 2022 15:06
Show Gist options
  • Save evankirkiles/de5eeafb41d179878dcf9d08a1a53195 to your computer and use it in GitHub Desktop.
Save evankirkiles/de5eeafb41d179878dcf9d08a1a53195 to your computer and use it in GitHub Desktop.
MEDIUM: Run Cascade Deletion in REST API from client
import { Auth, API } from "aws-amplify";
// ...
const id = "<some-clothe-id>";
const myInit = {
headers: {
Authorization: `Bearer ${(await Auth.currentSession())
.getIdToken()
.getJwtToken()}`,
},
};
const resp = await API.del("<my-wardrobe-api>", `/clothe/${id}`, myInit);
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment