Last active
November 5, 2024 21:12
-
-
Save Hasstrup/bef7e8e359e36dc2842d0b38d5acb953 to your computer and use it in GitHub Desktop.
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
class UsersController < ApplicationController | |
def show | |
context = ::Users::Contexts::Fetch.call(params: query_users_params, type: :single) | |
return error_response(context.message) unless context.success? | |
render json: UserBlueprint.render(context.payload), status: :ok | |
end | |
private | |
def query_users_params | |
@query_users_params ||= Users::QueryInput.new(fields: params.permit!.to_h) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment