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

feature request: Solicit.Response.from_status #148

Open
jollyjerr opened this issue May 7, 2024 · 0 comments
Open

feature request: Solicit.Response.from_status #148

jollyjerr opened this issue May 7, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jollyjerr
Copy link
Member

Currently, if I have a literal http status code I have to write my own translation layer:

case status_code do
  200 -> Solicit.Response.ok(conn)
  404 -> Solicit.Response.not_found(conn)
  #...
end

This is very error prone. I would like the ability to pass the status code to Solicit and have it do the translation:

Solicit.Response.from_status(status_code, %{example: "body"})
@jollyjerr jollyjerr added enhancement New feature or request good first issue Good for newcomers labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Development

No branches or pull requests

1 participant