Fix: Allow requests for creating and updating statuses to use FormData#171
Merged
Fix: Allow requests for creating and updating statuses to use FormData#171
Conversation
…a and JSON, not just JSON. Fixes #170
125cc1b to
5a181de
Compare
ThisIsMissEm
commented
Jun 14, 2025
| expect(json.application.name).toBe(application.name); | ||
| }); | ||
|
|
||
| it("Can update a status using JSON", async () => { |
Contributor
Author
There was a problem hiding this comment.
These tests are a little messy, but that's due to us not having a good way to mock a status object in the database, so instead I'm just creating first, then updating.
ThisIsMissEm
commented
Jun 14, 2025
| scopeRequired(["write:statuses"]), | ||
| zValidator( | ||
| "json", | ||
| app.post("/", tokenRequired, scopeRequired(["write:statuses"]), async (c) => { |
Contributor
Author
There was a problem hiding this comment.
The bulk of the lines changed here are due to whitespace.
dahlia
approved these changes
Jun 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous code only supported JSON, but Mastodon being ruby on rails supports params from both JSON and FormData. Fixes #170
We're also going to have similar issues with:
PATCH /api/v1/accounts/update_credentialsPOST /api/v1/accounts/:id/mutePOST /api/v1/featured_tagsPOST /api/v1/listsPUT /api/v1/lists/:idPOST /api/v1/lists/:id/accountsDELETE /api/v1/lists/:id/accountsPOST /api/v1/markersPOST /api/v1/polls/:id/votesPOST /api/v1/reportsSo we'll need to adjust all of those as well.