N
Nuxtβ€’7mo ago
goople

$fetch a POST request and got cancelled

Hello there, I need help with my nuxt project. I use $fetch to make a POST request my the api /specimens/edit/[id] (created with nuxt3) I use a .vue file to call "submitUpdate function. specimenStore.update calls $fetch (code screenshots attached) My goal is to submit changes from the form to the database and upload attached images to my object storage server. That's why I used FormData. Please help correct me if I use it incorrectly. Issue: 1. In the browser, it looks like the request has been processed (it updated the fields in the database) but in the Network tab of the developer tool shows "cancelled" as shown in the attached picture and there's no payload tab available to check what's going on in that request. (this happens only when I have a file input value) 2. The page is supposed to navigate to "/" but for some reasons what actually happens is it goes to "/" and then redirect back to the original page where the fetch request was made. The code screenshot used useFetch because I experiemented with useFetch but the issue happens regardless of using $fetch or useFetch I'm completely new to this and if I didn't provided enough information for getting help, please let me know. Thank you for your help in advance! πŸ™
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server