-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access data sent from frontend to custom endpoint #1661
Comments
@dziraf can you please look int this? |
Check |
@dziraf thanks, but I am unable to make use of the file I sent to the endpoint. I even used multer to handle it but to no avail.
Please how is it supposed to work? |
AdminJS uses old formidable middleware for forms, you shouldn't use multer. If you create an AdminJS action instead of an endpoint, the file will be available in request.payload without any extra backend code |
@dziraf please how can I use the "old formidable middleware" to send the file to the endpoint? Creating an action is not an option, because nowhere in your documentation is it explained how you can call an action when a custom button inside a frontend code is clicked. Or you have an example? |
@dziraf in my original setup above, I could read the file as shown below, but the problem is that I am unable to make use of it and send to s3. Please how am I supposed to upload it to s3?
|
I'm having the same problem right now, I read the file and send it to the client side, but I guess it doesn't return multiparta because the content-type is application/json, I couldn't find how to change it on the form, and since I'm new to admin.js, I looked at the documentation, but local upload seemed very complicated, now I will try sending it with base64. |
base64 image is working if you want ı can share my code @eakenbor |
Thanks @cetinirfan. This is what I did eventually:
I hope @dziraf and his team will do justice to their documentation because using this adminjs should not be this painful. |
Contact Details
No response
What happened?
I created a custom endpoint which connects well with the backend, but the data I sent is nowhere to be found.
Here is my code:
Please @dziraf can you help me with this?
Bug prevalence
Every time
AdminJS dependencies version
"adminjs": "^7.8.1",
What browsers do you see the problem on?
Chrome
Relevant log output
Relevant code that's giving you issues
No response
The text was updated successfully, but these errors were encountered: