Skip to content
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

Uploads #189

Merged
merged 18 commits into from
Oct 2, 2024
Merged

Uploads #189

merged 18 commits into from
Oct 2, 2024

Conversation

brunobuddy
Copy link
Contributor

@brunobuddy brunobuddy commented Oct 1, 2024

Description

This PR adds file and image upload to Manifest

How can it be tested?

  • First pull the develop branch of the website repository and launch the docs following the README.md. You should see the new Uploads doc now
  • From this repo, run npm run dev and play around with your /packages/core/manifest/manifest/backend.yml
  • Play around with new upload and file/image properties based on the doc
  • You can see the results through the admin panel and REST API (through Postman).

⚠️ I am thinking about a good way to test JS SDK features easily. It is not possible right now.

Impacted packages

Check the packages that require a new publication or release:

Check list before submitting

  • I have performed a self-review of my code (no debugs, no commented code, good naming, etc.)
  • I wrote the relative tests
  • I updated the documentation if necessary
  • This PR is wrote in a clear language and correctly labeled

@brunobuddy brunobuddy requested a review from SebConejo October 1, 2024 15:12
@brunobuddy brunobuddy self-assigned this Oct 1, 2024
Copy link

vercel bot commented Oct 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
manifest-schema ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 5:06pm

@brunobuddy brunobuddy marked this pull request as ready for review October 1, 2024 15:34
@SebConejo
Copy link
Contributor

SebConejo commented Oct 1, 2024

@brunobuddy I don't understand how to post an image using the rest API. Maybe you forgot something on the doc no ? I mean, you are showing a post without any image. So this example can't work.

If I want to post an image to the cat 48. I write that POST request:
POST http://localhost:1111/storage/cats/photo/Oct2024/1s8ug10j7m1qpixp5-thumbnail.jpg?property=image&entity=cats&id=48
I receive a 404 error :
http://localhost:1111/storage/cats/photo/Oct2024/1s8ug10j7m1qpixp5-thumbnail.jpg?property=image&entity=cats&id=48

@brunobuddy
Copy link
Contributor Author

@SebConejo

To post a multipart form-data request with an image using Postman, follow these steps:

Open Postman: Make sure you have Postman installed and running.

Create a new request:

Click on the + button to open a new tab.
Select the POST method.
Set the URL: Enter the URL where you want to send the request (e.g., your API endpoint).

Go to the "Body" tab:

Select the Body tab below the URL bar.
Choose form-data from the body options.
Add form-data fields:

In the first row under the Key column, enter the name of the field for the image file. For example, you can use "file", "image", or whatever your API expects.
In the Value column, click the dropdown on the right and choose File.
After selecting File, click on Select Files to upload the image from your system.
Add other fields if needed:

If your form-data includes additional fields (e.g., text fields), add more rows in the Key and Value columns and specify the type of each field (Text or File) as required.
Send the request:

Click on the Send button to post the request to the server.
You should receive a response from the server depending on your API configuration.
And that's it! You've just posted a multipart form-data request with an image using Postman. 🐺 Woof!

@SebConejo
Copy link
Contributor

SebConejo commented Oct 1, 2024

doing that generate a repsonse with this images.But then, I can see the images.
Capture d’écran 2024-10-01 à 20 14 57
Capture d’écran 2024-10-01 à 20 15 14

Mon code sur l'image des cats:
Capture d’écran 2024-10-01 à 20 20 02

@SebConejo
Copy link
Contributor

@brunobuddy J'approuve la PR mais j'ai ajouté une issue

@brunobuddy brunobuddy merged commit f1a823c into develop Oct 2, 2024
4 checks passed
@brunobuddy brunobuddy deleted the feature/uploads branch October 2, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants