Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/api/v3/private/user_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module API
module V3
module Private
class Api::V3::Private::UserController < ::ApplicationController
class Api::V3::Private::UserController < JSONAPI::ResourceController
include JwtAuthorizationConcern

def index
render json: { username: @current_user.id }
def context
{current_user: @current_user, params: params}
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/resources/api/v3/private/user_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class Api::V3::Private::UserResource < JSONAPI::Resource
key_type :string

paginator :none

exclude_links :default
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Don't generate links or relationship routes for decks.
jsonapi_resources :decks do
end
resources :user, only: [:index]
jsonapi_resources :user, only: [:index, :show]
end
namespace :public, defaults: { format: :json } do
jsonapi_resources :card_cycles, only: [:index, :show]
Expand Down