mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-30 20:23:14 +08:00
namespaces client_api/users/user_controller.rb
This commit is contained in:
parent
4ea4c30e29
commit
e4a704d063
3 changed files with 18 additions and 17 deletions
16
app/controllers/client_api/users/users_controller.rb
Normal file
16
app/controllers/client_api/users/users_controller.rb
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
module ClientApi
|
||||||
|
module Users
|
||||||
|
class UsersController < ApplicationController
|
||||||
|
|
||||||
|
def current_user_info
|
||||||
|
respond_to do |format|
|
||||||
|
format.json do
|
||||||
|
render template: '/client_api/users/show',
|
||||||
|
status: :ok,
|
||||||
|
locals: { user: current_user }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,14 +0,0 @@
|
||||||
module ClientApi
|
|
||||||
class UsersController < ApplicationController
|
|
||||||
|
|
||||||
def current_user_info
|
|
||||||
respond_to do |format|
|
|
||||||
format.json do
|
|
||||||
render template: '/client_api/users/show',
|
|
||||||
status: :ok,
|
|
||||||
locals: { user: current_user }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -8,11 +8,10 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
root 'projects#index'
|
root 'projects#index'
|
||||||
|
|
||||||
# Settings root
|
# Client APP endpoints
|
||||||
get '/settings', to: 'client_api/settings#index'
|
get '/settings', to: 'client_api/settings#index'
|
||||||
get '/settings/*all', to: 'client_api/settings#index'
|
get '/settings/*all', to: 'client_api/settings#index'
|
||||||
|
|
||||||
# Client APP endpoints
|
|
||||||
namespace :client_api, defaults: { format: 'json' } do
|
namespace :client_api, defaults: { format: 'json' } do
|
||||||
# activities
|
# activities
|
||||||
get '/activities', to: 'activities#index'
|
get '/activities', to: 'activities#index'
|
||||||
|
@ -22,7 +21,7 @@ Rails.application.routes.draw do
|
||||||
# notifications
|
# notifications
|
||||||
get '/recent_notifications', to: 'notifications#recent_notifications'
|
get '/recent_notifications', to: 'notifications#recent_notifications'
|
||||||
# users
|
# users
|
||||||
get '/current_user_info', to: 'users#current_user_info'
|
get '/current_user_info', to: 'users/users#current_user_info'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Save sample table state
|
# Save sample table state
|
||||||
|
|
Loading…
Reference in a new issue