diff --git a/components/story/atoms/actions.vue b/components/story/atoms/actions.vue new file mode 100644 index 0000000..03a2d2f --- /dev/null +++ b/components/story/atoms/actions.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/lib/client/storyActions.ts b/lib/client/storyActions.ts new file mode 100644 index 0000000..53191bd --- /dev/null +++ b/lib/client/storyActions.ts @@ -0,0 +1,6 @@ +import { useApiFetch } from "#imports"; + +export async function deleteStory(id: number) { + await useApiFetch(`/story/${id}`, { method: "delete" }); + await navigateTo("/my-stuff/stories"); +}