Sha256: 8d38fc2234e30ad695950d6380312980c258a277172b5183a3e591038b07f45a

Contents?: true

Size: 1.85 KB

Versions: 9

Compression:

Stored size: 1.85 KB

Contents

# frozen_string_literal: true

module Maestrano
  module Api
    module Concerns
      module AccountController
        extend ActiveSupport::Concern

        #==================================================================
        # Included methods
        #==================================================================
        # 'included do' causes the included code to be evaluated in the
        # context where it is included rather than being executed in the
        # module's context
        included do
        end

        #==================================================================
        # Class methods
        #==================================================================
        module ClassMethods
        end

        #==================================================================
        # Instance methods
        #==================================================================
        def setup_form
          form = {
            schema: {
              type: 'object',
              properties: {
                array: {
                  title: 'You have not configured your schema form',
                  type: 'array',
                  items: {
                    type: 'string',
                    enum: [
                      "Ok I'll do it right away",
                      "I'll let someone else do it for me"
                    ]
                  }
                }
              }
            }
          }
          render json: form.to_json
        end

        def link_account
          render json: {error: 'Method to link account has not been implemented'}
        end

        def unlink_account
          organization = Maestrano::Connector::Rails::Organization.find_by(uid: params[:uid])
          organization.clear_omniauth
          render json: {status: 'ok'}.to_json
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.3.6 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.3.5 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.3.4 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.3.3 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.3.2 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.3.1 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.3.0 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.2.1 app/controllers/maestrano/api/concerns/account_controller.rb
maestrano-connector-rails-2.2.0 app/controllers/maestrano/api/concerns/account_controller.rb