Sha256: 1907aec861cf6d30041697a212eef654a53b004aaf488c182ac5b747f975601d

Contents?: true

Size: 830 Bytes

Versions: 142

Compression:

Stored size: 830 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/letters"

module Renalware
  module Letters
    class CompletedLettersController < Letters::BaseController
      before_action :load_patient

      # HTML GET for insertion into modal dialog
      def new
        render layout: false, locals: {
          letter: letter
        }
      end

      def create
        CompleteLetter.build(letter).call(by: current_user)

        respond_to do |format|
          format.html do
            redirect_to patient_letters_letter_path(@patient, letter), notice: t(".success")
          end
          format.js do
            render locals: { letter: letter }
          end
        end
      end

      private

      def letter
        @letter ||= @patient.letters.approved.find(params[:letter_id])
      end
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.0.127 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.126 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.125 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.124 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.123 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.121 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.120 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.119 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.118 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.117 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.116 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.115 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.113 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.112 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.111 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.110 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.109 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.108 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.106 app/controllers/renalware/letters/completed_letters_controller.rb
renalware-core-2.0.105 app/controllers/renalware/letters/completed_letters_controller.rb