Planetable / Planet

Build and host decentralized blogs and websites on your Mac
https://planetable.xyz
MIT License
1.45k stars 61 forks source link

Remove legacy api support. #378

Closed kailuo closed 3 months ago

kailuo commented 3 months ago

There's one minor update to the parameters in creating and modifying article method: Previously:

curl -X POST http://127.0.0.1:8086/v0/planets/my/999BB908-B79A-4C89-8DA6-1339BDFCE03E/articles \
  -F "attachment=@example.jpeg" \
  -F "title=title" \
  -F "content=content"

Now:

curl -X POST http://127.0.0.1:8086/v0/planets/my/999BB908-B79A-4C89-8DA6-1339BDFCE03E/articles \
  -F "attachments[0]=@example.jpeg" \
  -F "title=title" \
  -F "content=content"
livid commented 3 months ago

There's one minor update to the parameters in creating and modifying article method: Previously:

curl -X POST http://127.0.0.1:8086/v0/planets/my/999BB908-B79A-4C89-8DA6-1339BDFCE03E/articles \
  -F "attachment=@example.jpeg" \
  -F "title=title" \
  -F "content=content"

Now:

curl -X POST http://127.0.0.1:8086/v0/planets/my/999BB908-B79A-4C89-8DA6-1339BDFCE03E/articles \
  -F "attachments[0]=@example.jpeg" \
  -F "title=title" \
  -F "content=content"

If possible, I hope the code can support both attachment and attachments, so the existing clients (if any) do not need to update.

kailuo commented 3 months ago

Hmm, should be possible, let me take a look.