PuzzledApples
TTCTheo's Typesafe Cult
•Created by PuzzledApples on 10/26/2024 in #questions
XHR/Axios Progress with Server Actions
I have figured a possible solution? However, I'm unsure if it makes sense to do so or just seems redundant?
But I have created an API route to effectively collect the data; then send it to a controller to separate the
formData
and create different variables for the files and the payload; then I pass that controller data down to the server action.
This does seem to be working.
The API route looks something like this:
The controller looks something like this:
I then reconfigured my server action to take in the Files: File[]
instead of the formData: FormData
, along with some other general changes.6 replies
TTCTheo's Typesafe Cult
•Created by PuzzledApples on 10/26/2024 in #questions
XHR/Axios Progress with Server Actions
I have also tried to add this to the
async function handleOnSubmit(e: any)
function
This will upload the content through the Server Action but won't run the rest of the operation such as onUploadProgress
or the completed .then
. It returns the response error
of POST https://DEVSERVER/PAGE/[object%20Promise] 404 (Not Found)
.6 replies
TTCTheo's Typesafe Cult
•Created by PuzzledApples on 10/26/2024 in #questions
XHR/Axios Progress with Server Actions
6 replies
TTCTheo's Typesafe Cult
•Created by PuzzledApples on 10/26/2024 in #questions
XHR/Axios Progress with Server Actions
and my upload file is currently looking like this:
6 replies