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

Add delete request to HttpClient #56555

Merged
merged 2 commits into from
Feb 14, 2024
Merged

Conversation

fisher-alice
Copy link
Contributor

@fisher-alice fisher-alice commented Feb 13, 2024

This PR adds a send DELETE request function to HttpClient. I plan to use this new function in #56532. Other requests made in FeaturedProjectsTable use ajax and when I attempted to use fetch instead, I received a 422 (unprocessable entity) server error because the authenticity token was required. Thus, I wanted to use a request function from HttpClient but 'delete' was not yet available.

Links

Testing story

I tested locally in conjunction with changes in #56532 checking both DELETE and PUT requests.

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@fisher-alice fisher-alice marked this pull request as ready for review February 13, 2024 22:29
@fisher-alice fisher-alice requested a review from a team February 13, 2024 22:29
@@ -74,12 +74,13 @@ async function fetchJson<ResponseType>(
}

/**
* POST to the given endpoint. Adds the Rails authenticity
* o to the given endpoint. Adds the Rails authenticity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: update comment - maybe "Sends a request to the given endpoint"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah! Forgot to fix this - updated. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And thanks for pairing with me on this @sanchitmalhotra126 !

@fisher-alice fisher-alice merged commit 9acfd42 into staging Feb 14, 2024
2 checks passed
@fisher-alice fisher-alice deleted the alice/update-http-client branch February 14, 2024 00:28
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.

None yet

2 participants