diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb new file mode 100644 index 00000000..3505d73a --- /dev/null +++ b/app/controllers/api/users_controller.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Api + class UsersController < ApiBaseController + authorize_resource :current_user + + def show + render json: current_user.as_json(only: %i[id first_name last_name email]) + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 85fa2b5d..a3e90fc8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,6 +28,7 @@ Rails.application.routes.draw do end namespace :api, defaults: { format: :json } do + resource :user, only: %i[show] resources :attachments, only: %i[create] resources :submitter_email_clicks, only: %i[create] resources :submitter_form_views, only: %i[create]