mno-enterprise-api 3.0.7 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mno_enterprise/config.js.coffee.erb +2 -0
  3. data/app/controllers/mno_enterprise/impersonate_controller.rb +1 -2
  4. data/app/controllers/mno_enterprise/jpi/v1/admin/audit_events_controller.rb +2 -2
  5. data/app/controllers/mno_enterprise/jpi/v1/admin/invites_controller.rb +50 -0
  6. data/app/controllers/mno_enterprise/jpi/v1/admin/invoices_controller.rb +13 -27
  7. data/app/controllers/mno_enterprise/jpi/v1/admin/organizations_controller.rb +82 -1
  8. data/app/controllers/mno_enterprise/jpi/v1/admin/users_controller.rb +9 -1
  9. data/app/controllers/mno_enterprise/jpi/v1/app_instances_sync_controller.rb +2 -2
  10. data/app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb +1 -1
  11. data/app/controllers/mno_enterprise/status_controller.rb +2 -4
  12. data/app/views/mno_enterprise/auth/confirmations/_form.html.haml +2 -2
  13. data/app/views/mno_enterprise/auth/registrations/_form.html.haml +1 -1
  14. data/app/views/mno_enterprise/auth/unlocks/new.html.haml +11 -11
  15. data/app/views/mno_enterprise/jpi/v1/admin/base_resource/_member.json.jbuilder +28 -0
  16. data/app/views/mno_enterprise/jpi/v1/admin/organizations/invite_member.json.jbuilder +3 -0
  17. data/app/views/mno_enterprise/jpi/v1/admin/organizations/show.json.jbuilder +2 -2
  18. data/app/views/mno_enterprise/jpi/v1/admin/users/_user.json.jbuilder +1 -1
  19. data/app/views/mno_enterprise/jpi/v1/admin/users/show.json.jbuilder +2 -1
  20. data/app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder +1 -0
  21. data/app/views/mno_enterprise/jpi/v1/impac/kpis/_kpi.json.jbuilder +1 -1
  22. data/app/views/mno_enterprise/jpi/v1/marketplace/_app.json.jbuilder +1 -1
  23. data/app/views/mno_enterprise/jpi/v1/organizations/_credit_card.json.jbuilder +2 -2
  24. data/config/initializers/health_check.rb +5 -3
  25. data/config/routes.rb +8 -1
  26. data/lib/mno_enterprise/concerns/controllers/jpi/v1/organizations_controller.rb +0 -1
  27. data/lib/mno_enterprise/concerns/mailers/system_notification_mailer.rb +19 -5
  28. data/spec/controllers/mno_enterprise/impersonate_controller_spec.rb +4 -14
  29. data/spec/controllers/mno_enterprise/jpi/v1/admin/invites_controller_spec.rb +63 -0
  30. data/spec/controllers/mno_enterprise/jpi/v1/admin/invoices_controller_spec.rb +4 -14
  31. data/spec/controllers/mno_enterprise/jpi/v1/admin/organizations_controller_spec.rb +65 -0
  32. data/spec/controllers/mno_enterprise/jpi/v1/admin/users_controller_spec.rb +16 -16
  33. data/spec/controllers/mno_enterprise/jpi/v1/app_instances_sync_controller_spec.rb +14 -22
  34. data/spec/controllers/mno_enterprise/jpi/v1/current_users_controller_spec.rb +4 -1
  35. data/spec/controllers/mno_enterprise/jpi/v1/impac/kpis_controller_spec.rb +2 -2
  36. data/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb +43 -2
  37. data/spec/controllers/mno_enterprise/pages_controller_spec.rb +0 -4
  38. data/spec/controllers/mno_enterprise/status_controller_spec.rb +0 -4
  39. data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +1 -5
  40. data/spec/mailer/mno_enterprise/system_notification_mailer_spec.rb +23 -11
  41. data/spec/routing/mno_enterprise/jpi/v1/admin/invites_controller_routing_spec.rb +11 -0
  42. data/spec/routing/mno_enterprise/jpi/v1/admin/organizations_controller_routing_spec.rb +8 -0
  43. data/spec/routing/mno_enterprise/jpi/v1/admin/users_controller_routing_spec.rb +4 -0
  44. metadata +13 -8
  45. data/app/views/mno_enterprise/auth/unlocks/_form.html.haml +0 -10
  46. data/app/views/mno_enterprise/jpi/v1/admin/organizations/_member.json.jbuilder +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fea0c5b9f868b772e58b138f599bf47ff3504999
4
- data.tar.gz: fbc019fc11c8c18a5d7f4778f815664156e626a8
3
+ metadata.gz: a0b34731abb419f0c73fd4df71ebb069e531efe0
4
+ data.tar.gz: 3e20d7533d0c64aef461de97bb9559d31f894929
5
5
  SHA512:
6
- metadata.gz: 5a5869e83ffccf97c1fda4f8f409c873dd93252adde7e525aa0d8e17089e101b4139dfcd872ffa8d16ac9a44c38d94d60a817f14c31b67736ede61f75adee614
7
- data.tar.gz: d47a98b004477bfed67a5209ebec0857320753c074913d9dfd0b1c693f0dc65e3b92d041b270850587a5b7c97edd82e03cf726306851679a394437d647801cbc
6
+ metadata.gz: 22b2d455051e5434e13bdef392524ec18b8d576e55ddc325ebde46df41b55858a103b9a8749853281740570e1da42739505f34ffe7becbb302983cca932618f2
7
+ data.tar.gz: 42f2b1aab4920f54304191e9fad4f39e98128afd74a99a71dd2a2b50acfa0c500fbd93476488ac5a58d9c26d3343f5921b2f65ada23f8cc2d31993ae7293d41f
@@ -8,3 +8,5 @@ angular.module('mnoEnterprise.configuration', [])
8
8
  enabled: <%= MnoEnterprise.i18n_enabled %>,
9
9
  available_locales: <%= I18n.available_locales.to_json %>
10
10
  })
11
+ .constant('PRICING_CONFIG', <%= Settings.pricing.to_json %>)
12
+ .constant('GOOGLE_TAG_CONTAINER_ID', <%= MnoEnterprise.google_tag_container.to_json %>)
@@ -8,7 +8,6 @@ module MnoEnterprise
8
8
  # Perform the user impersonate action
9
9
  # GET /impersonate/user/123
10
10
  def create
11
- session[:impersonator_redirect_path] = params[:redirect_path].presence
12
11
  @user = MnoEnterprise::User.find(params[:user_id])
13
12
  if @user.present?
14
13
  impersonate(@user)
@@ -25,7 +24,7 @@ module MnoEnterprise
25
24
  # user = current_user
26
25
  revert_impersonate
27
26
  end
28
- redirect_to session.delete(:impersonator_redirect_path).presence || '/admin/'
27
+ redirect_to '/admin/'
29
28
  end
30
29
 
31
30
  private
@@ -1,6 +1,6 @@
1
1
  module MnoEnterprise
2
2
  class Jpi::V1::Admin::AuditEventsController < Jpi::V1::Admin::BaseResourceController
3
-
3
+
4
4
  # GET /mnoe/jpi/v1/admin/audit_events
5
5
  def index
6
6
  @audit_events = MnoEnterprise::AuditEvent
@@ -8,7 +8,7 @@ module MnoEnterprise
8
8
  @audit_events = @audit_events.skip(params[:offset]) if params[:offset]
9
9
  @audit_events = @audit_events.order_by(params[:order_by]) if params[:order_by]
10
10
  @audit_events = @audit_events.where(params[:where]) if params[:where]
11
- @audit_events = @audit_events.all.fetch
11
+ @audit_events = @audit_events.all
12
12
 
13
13
  response.headers['X-Total-Count'] = @audit_events.metadata[:pagination][:count]
14
14
  end
@@ -0,0 +1,50 @@
1
+ module MnoEnterprise::Jpi::V1::Admin
2
+ # Manage invitation sending
3
+ class InvitesController < BaseResourceController
4
+ def create
5
+ @organization = MnoEnterprise::Organization.find(params[:organization_id])
6
+ user = MnoEnterprise::User.find(params[:user_id])
7
+ return render json: {error: 'Could not find account or user'}, status: :not_found unless @organization && user
8
+
9
+ if user.confirmation_required?
10
+ user.resend_confirmation_instructions
11
+ else
12
+ invite = find_org_invite(@organization, user)
13
+ return render json: {error: 'No active invitation found'}, status: :not_found unless invite
14
+ send_org_invite(invite)
15
+ end
16
+
17
+ MnoEnterprise::EventLogger.info('user_invite', current_user.id, 'User invited', {user_email: user.email, account_name: @organization.name}, user)
18
+
19
+ @user = user.confirmed? ? invite : user.reload
20
+
21
+ render 'mno_enterprise/jpi/v1/admin/organizations/invite_member'
22
+ end
23
+
24
+ private
25
+
26
+ # Invite for unconfirmed users are automatically accepted
27
+ def find_org_invite(organization, user)
28
+ if user.confirmed?
29
+ status_scope = { 'status.in' => %w(staged pending) }
30
+ else
31
+ status_scope = { status: 'accepted' }
32
+ end
33
+ organization.org_invites.where(status_scope.merge(user_id: user.id)).first
34
+ end
35
+
36
+ # Send the org invite and update the status
37
+ def send_org_invite(invite)
38
+ user = invite.user
39
+ # Generate token if not generated
40
+ user.send(:generate_confirmation_token!) if !user.confirmed? && user.confirmation_token.blank?
41
+
42
+ MnoEnterprise::SystemNotificationMailer.organization_invite(invite).deliver_later
43
+
44
+ # Update staged invite status
45
+ return unless invite.status == 'staged'
46
+ invite.status = 'pending'
47
+ invite.save
48
+ end
49
+ end
50
+ end
@@ -13,49 +13,35 @@ module MnoEnterprise
13
13
 
14
14
  # GET /mnoe/jpi/v1/admin/invoices/current_billing_amount
15
15
  def current_billing_amount
16
- # Backward compatibility with old MnoHub (<= v1.0.2)
17
- # TODO: Remove once all mnohub are migrated to newer versions
18
- tenant.respond_to?(:current_billing_amount) && current_billing = tenant.current_billing_amount
19
-
20
- render json: {current_billing_amount: format_money(current_billing)}
16
+ data = Rails.cache.fetch('tenant_admin/current_billing_amount', expires_in: ADMIN_CACHE_DURATION) do
17
+ billing = MnoEnterprise::Organization.all.map(&:current_billing).sum(Money.new(0))
18
+ {current_billing_amount: {amount: billing.amount, currency: billing.currency_as_string}}
19
+ end
20
+ render json: data
21
21
  end
22
22
 
23
23
  # GET /mnoe/jpi/v1/admin/invoices/last_invoicing_amount
24
24
  def last_invoicing_amount
25
- tenant_billing = tenant.last_customers_invoicing_amount
26
- render json: {last_invoicing_amount: format_money(tenant_billing)}
25
+ tenant_billing = MnoEnterprise::Tenant.get('tenant').last_customers_invoicing_amount
26
+ render json: {last_invoicing_amount: {amount: tenant_billing.amount, currency: tenant_billing.currency_as_string}}
27
27
  end
28
28
 
29
29
  # GET /mnoe/jpi/v1/admin/invoices/outstanding_amount
30
30
  def outstanding_amount
31
- tenant_billing = tenant.last_customers_outstanding_amount
32
- render json: {outstanding_amount: format_money(tenant_billing)}
31
+ tenant_billing = MnoEnterprise::Tenant.get('tenant').last_customers_outstanding_amount
32
+ render json: {outstanding_amount: {amount: tenant_billing.amount, currency: tenant_billing.currency_as_string}}
33
33
  end
34
34
 
35
35
  # GET /mnoe/jpi/v1/admin/invoices/last_portfolio_amount
36
36
  def last_portfolio_amount
37
- tenant_billing = tenant.last_portfolio_amount
38
- render json: {last_portfolio_amount: format_money(tenant_billing)}
37
+ tenant_billing = MnoEnterprise::Tenant.get('tenant').last_portfolio_amount
38
+ render json: {last_portfolio_amount: {amount: tenant_billing.amount, currency: tenant_billing.currency_as_string}}
39
39
  end
40
40
 
41
41
  # GET /mnoe/jpi/v1/admin/invoices/last_commission_amount
42
42
  def last_commission_amount
43
- tenant_billing = tenant.last_commission_amount
44
- render json: {last_commission_amount: format_money(tenant_billing)}
45
- end
46
-
47
- private
48
-
49
- def tenant
50
- @tenant ||= MnoEnterprise::Tenant.show
51
- end
52
-
53
- def format_money(money)
54
- if money
55
- {amount: money.amount, currency: money.currency_as_string}
56
- else
57
- {amount: 'N/A', currency: ''}
58
- end
43
+ tenant_billing = MnoEnterprise::Tenant.get('tenant').last_commission_amount
44
+ render json: {last_commission_amount: {amount: tenant_billing.amount, currency: tenant_billing.currency_as_string}}
59
45
  end
60
46
  end
61
47
  end
@@ -15,7 +15,7 @@ module MnoEnterprise
15
15
  @organizations = @organizations.skip(params[:offset]) if params[:offset]
16
16
  @organizations = @organizations.order_by(params[:order_by]) if params[:order_by]
17
17
  @organizations = @organizations.where(params[:where]) if params[:where]
18
- @organizations = @organizations.all.fetch
18
+ @organizations = @organizations.all
19
19
  response.headers['X-Total-Count'] = @organizations.metadata[:pagination][:count]
20
20
  end
21
21
  end
@@ -36,5 +36,86 @@ module MnoEnterprise
36
36
  organizations_count = MnoEnterprise::Tenant.get('tenant').organizations_count
37
37
  render json: {count: organizations_count }
38
38
  end
39
+
40
+ # POST /mnoe/jpi/v1/admin/organizations
41
+ def create
42
+ # Create new organization
43
+ @organization = MnoEnterprise::Organization.create(organization_update_params)
44
+
45
+ # OPTIMIZE: move this into a delayed job?
46
+ update_app_list
47
+
48
+ @organization_active_apps = @organization.app_instances
49
+
50
+ render 'show'
51
+ end
52
+
53
+ # POST /mnoe/jpi/v1/admin/organizations/1/users
54
+ # Invite a user to the organization (and create it if needed)
55
+ # This does not send any emails (emails are manually triggered later)
56
+ def invite_member
57
+ @organization = MnoEnterprise::Organization.find(params[:id])
58
+
59
+ # Find or create a new user - We create it in the frontend as MnoHub will send confirmation instructions for newly
60
+ # created users
61
+ user = MnoEnterprise::User.find_by(email: user_params[:email]) || create_unconfirmed_user(user_params)
62
+
63
+ # Create the invitation
64
+ invite = @organization.org_invites.create(
65
+ user_email: user.email,
66
+ user_role: params[:user][:role],
67
+ referrer_id: current_user.id,
68
+ status: 'staged' # Will be updated to 'accepted' for unconfirmed users
69
+ )
70
+
71
+ @user = user.confirmed? ? invite : user.reload
72
+ end
73
+
74
+ protected
75
+ def organization_permitted_update_params
76
+ [:name]
77
+ end
78
+
79
+ def organization_update_params
80
+ params.fetch(:organization, {}).permit(*organization_permitted_update_params)
81
+ end
82
+
83
+ def user_params
84
+ params.require(:user).permit(:email, :name, :surname, :phone)
85
+ end
86
+
87
+ # Create an unconfirmed user and skip the confirmation notification
88
+ # TODO: monkey patch User#confirmation_required? to simplify this? Use refinements?
89
+ def create_unconfirmed_user(user_params)
90
+ user = MnoEnterprise::User.new(user_params)
91
+ user.skip_confirmation_notification!
92
+ user.save
93
+
94
+ # Reset the confirmation field so we can track when the invite is send - #confirmation_sent_at is when the confirmation_token was generated (not sent)
95
+ # Not ideal as we do 2 saves, and the previous save trigger a call to the backend to validate the token uniqueness
96
+ user.assign_attributes(confirmation_sent_at: nil, confirmation_token: nil)
97
+ user.save
98
+ user
99
+ end
100
+
101
+ # Update App List to match the list passed in params
102
+ def update_app_list
103
+ # Differentiate between a null app_nids params and no app_nids params
104
+ if params[:organization].key?(:app_nids) && (desired_nids = Array(params[:organization][:app_nids]))
105
+
106
+ existing_apps = @organization.app_instances.active
107
+
108
+ existing_apps.each do |app_instance|
109
+ desired_nids.delete(app_instance.app.nid) || app_instance.terminate
110
+ end
111
+
112
+ desired_nids.each do |nid|
113
+ @organization.app_instances.create(product: nid)
114
+ end
115
+
116
+ # Force reload
117
+ existing_apps.reload
118
+ end
119
+ end
39
120
  end
40
121
  end
@@ -15,7 +15,7 @@ module MnoEnterprise
15
15
  @users = @users.skip(params[:offset]) if params[:offset]
16
16
  @users = @users.order_by(params[:order_by]) if params[:order_by]
17
17
  @users = @users.where(params[:where]) if params[:where]
18
- @users = @users.all.fetch
18
+ @users = @users.all
19
19
  response.headers['X-Total-Count'] = @users.metadata[:pagination][:count]
20
20
  end
21
21
  end
@@ -60,6 +60,14 @@ module MnoEnterprise
60
60
  render json: {count: users_count }
61
61
  end
62
62
 
63
+ # POST /mnoe/jpi/v1/admin/users/signup_email
64
+ # Send an email to a user with the link to the registration page
65
+ def signup_email
66
+ MnoEnterprise::SystemNotificationMailer.registration_instructions(params.require(:user).require(:email)).deliver_later
67
+
68
+ head :no_content
69
+ end
70
+
63
71
  private
64
72
 
65
73
  def user_params
@@ -1,6 +1,5 @@
1
1
  module MnoEnterprise
2
2
  class Jpi::V1::AppInstancesSyncController < Jpi::V1::BaseResourceController
3
- CONNECTOR_STATUS_RUNNING = ['PENDING', 'RUNNING']
4
3
 
5
4
  # GET /mnoe/jpi/v1/organization/org-fbba/app_instances_sync
6
5
  def index
@@ -29,8 +28,9 @@ module MnoEnterprise
29
28
  def results(connectors)
30
29
  {
31
30
  connectors: connectors,
32
- is_syncing: connectors.any? { |c| CONNECTOR_STATUS_RUNNING.include?(c[:status]) }
31
+ is_syncing: connectors.any?{|c| c[:status]=="RUNNING" }
33
32
  }
34
33
  end
34
+
35
35
  end
36
36
  end
@@ -9,7 +9,7 @@ module MnoEnterprise
9
9
  else
10
10
  MnoEnterprise::App.all.to_a
11
11
  end
12
-
12
+ @apps.sort_by! { |app| [app.rank ? 0 : 1 , app.rank] } # the nil ranks will appear at the end
13
13
  @categories = MnoEnterprise::App.categories(@apps)
14
14
  @categories.delete('Most Popular')
15
15
  end
@@ -13,15 +13,13 @@ module MnoEnterprise
13
13
  # {
14
14
  # 'app-version': '9061048-6811c4a',
15
15
  # 'mno-enterprise-version': '0.0.1',
16
- # 'env': 'test',
17
- # 'mno-api-host': 'https://uat.maestrano.io'
16
+ # 'env': 'test'
18
17
  # }
19
18
  def version
20
19
  data = {
21
20
  'app-version' => MnoEnterprise::APP_VERSION,
22
21
  'mno-enteprise-version' => MnoEnterprise::VERSION,
23
- 'env' => Rails.env,
24
- 'mno-api-host' => MnoEnterprise.mno_api_host
22
+ 'env' => Rails.env
25
23
  }
26
24
  render json: data
27
25
  end
@@ -1,4 +1,4 @@
1
- %div{ 'ng-init' => "user = { $pwdScore: {}, name: '#{resource.name}', surname: '#{resource.surname}', phone: '#{resource.phone}' }" }
1
+ %div{ 'ng-init' => "user = { $pwdScore: {}, name: '#{resource.name}', surname: '#{resource.surname}' }" }
2
2
 
3
3
  = form_for(resource, as: resource_name, :url => mno_enterprise.user_confirmation_finalize_path, :html => { 'name' => 'loginForm', :class => 'autofill-detect text-center' }) do |f|
4
4
 
@@ -18,7 +18,7 @@
18
18
  .col-sm-12
19
19
  .phone
20
20
  = f.select :phone_country_code, options_for_select(Country.all.map { |country,code| c = Country.new(code); ["#{c.alpha2} +#{c.country_code}", code]}, MnoEnterprise.app_country), {}, class: 'form-control unstyled'
21
- = f.text_field :phone, placeholder: "*Phone", required: true, 'ng-model' => 'user.phone', class: 'form-control'
21
+ = f.text_field :phone, placeholder: "*Phone", required: true, 'ng-model' => 'user.phone_number', class: 'form-control'
22
22
 
23
23
  %br
24
24
 
@@ -25,7 +25,7 @@
25
25
  .checkbox-section.text-center
26
26
  = check_box_tag 'tos', 'accept', false, :required => true, :style => "margin-top: -3px;", 'ng-model' => 'acceptTos'
27
27
  %label{for: 'tos'}= t('mno_enterprise.auth.registrations.new.user_accept')
28
- = link_to t('mno_enterprise.auth.registrations.new.tos'), MnoEnterprise.router.terms_url, target: '_blank'
28
+ = link_to t('.tos'), MnoEnterprise.router.terms_url, target: '_blank'
29
29
 
30
30
  %br
31
31
  .row
@@ -1,11 +1,11 @@
1
- .registration
2
- .container
3
- .row
4
- .login-box-wrapper
5
- .login-box-title
6
- %h2= t('.title')
7
- .login-box
8
- .brand-logo
9
- = render "mno_enterprise/auth/unlocks/form"
10
- %hr
11
- = render "mno_enterprise/auth/shared/links"
1
+ %h2= t('.title')
2
+ = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
3
+ = devise_error_messages!
4
+ .field
5
+ = f.label :email
6
+ %br/
7
+ = f.email_field :email, autofocus: true
8
+ .actions
9
+ = f.submit t('.unlock')
10
+
11
+ = render "devise/shared/links"
@@ -0,0 +1,28 @@
1
+ if member.is_a?(MnoEnterprise::User)
2
+ json.uid member.uid
3
+ json.entity 'User'
4
+ json.role member.role(organization) if organization
5
+
6
+ status = case
7
+ when member.confirmed? then 'active'
8
+ when member.confirmation_sent_at.nil? then 'pending'
9
+ when member.confirmation_sent_at.present? then 'invited'
10
+ end
11
+
12
+ user = member
13
+
14
+ elsif member.is_a?(MnoEnterprise::OrgInvite)
15
+ json.entity 'OrgInvite'
16
+ json.role member.user_role
17
+
18
+ status = case member.status
19
+ when 'staged' then 'pending'
20
+ when 'pending' then 'invited'
21
+ when 'accepted' then 'active'
22
+ end
23
+
24
+ user = member.user
25
+ end
26
+
27
+ json.extract! user, :id, :created_at, :email, :name, :surname
28
+ json.status status
@@ -0,0 +1,3 @@
1
+ json.user do
2
+ json.partial! 'member', member: @user, organization: @organization
3
+ end
@@ -1,10 +1,10 @@
1
1
  json.organization do
2
2
  json.partial! 'organization', organization: @organization
3
- json.members @organization.members, partial: 'member', as: :member, organization: @organization
3
+ json.members @organization.members(true), partial: 'member', as: :member, organization: @organization
4
4
  json.partial! 'credit_card', credit_card: @organization.credit_card
5
5
  json.partial! 'invoices', organization: @organization
6
6
  json.active_apps @organization_active_apps do |instance|
7
- json.extract! instance, :id, :name, :stack, :uid
7
+ json.extract! instance, :id, :name, :stack, :uid, :status, :oauth_keys_valid
8
8
  json.app_name instance.app.name
9
9
  json.app_logo instance.app.logo
10
10
  end
@@ -1 +1 @@
1
- json.extract! user, :id, :uid, :email, :name, :surname, :admin_role, :created_at
1
+ json.extract! user, :id, :uid, :email, :phone, :name, :surname, :admin_role, :created_at, :confirmed_at, :last_sign_in_at
@@ -1,5 +1,6 @@
1
1
  json.user do
2
- json.extract! @user, :id, :uid, :email, :phone, :name, :surname, :admin_role, :created_at, :confirmed_at, :last_sign_in_at
2
+ json.partial! 'user', user: @user
3
+
3
4
  json.organizations @user_organizations do |org|
4
5
  json.id org.id
5
6
  json.uid org.uid