Skip to content

Commit

Permalink
upload story directly
Browse files Browse the repository at this point in the history
  • Loading branch information
fidelthomet committed Aug 27, 2024
1 parent 1b730fd commit 3acb8d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stores/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ export const useStoryStore = defineStore('story', () => {
async function uploadStory(id) {
const url = import.meta.env.VITE_STORIES_API_URL

const story = JSON.parse(localStorage.getItem(`story-${id}`))
// const story = JSON.parse(localStorage.getItem(`story-${id}`))

const res = await fetch(url, {
method: 'POST',
body: JSON.stringify({ [`story-${id}`]: story })
// body: JSON.stringify({ [`story-${id}`]: story })
body: localStorage.getItem(`story-${id}`)
})

console.log(res)
Expand Down

0 comments on commit 3acb8d3

Please sign in to comment.