Sha256: ec2f8517107ff9e4cd2268147632d3d4355660475d19c899a736fb5f058805a9

Contents?: true

Size: 1.17 KB

Versions: 24

Compression:

Stored size: 1.17 KB

Contents

module Ecom
  module Core
    class ProjectsController < ApplicationController
      before_action :set_project, only: %i[show]
      # GET /projects
      def index
        projects = Ecom::Core::Project.includes(:employer, :contractor, :consultant, :project_manager)
                                      .where(company_id: params[:id])
        serialized = ActiveModelSerializers::SerializableResource.new(projects)
        render json: { success: true, data: serialized }
      end

      def show
        render json: @project
      end

      private

      def set_project
        @project = Project.find(params[:id])
      end

      def model_params
        params.require(:project).permit(:name, :description, :location, :objective, :project_scope, :employer_id,
                                        :contractor_id, :consultant_id, :project_manager_id, :contract_number,
                                        :company_id, :date_contract_signed, :commencement_date, :completion_date,
                                        :contract_amount, :advance_payment, :retention, :remark, :task_template_type_id,
                                        :currency_id)
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ecom_core-1.3.14 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.13 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.12 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.11 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.10 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.9 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.8 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.7 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.6 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.5 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.4 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.3 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.2 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.1 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.3.0 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.2.36 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.2.35 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.2.34 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.2.33 app/controllers/ecom/core/projects_controller.rb
ecom_core-1.2.32 app/controllers/ecom/core/projects_controller.rb