Add create_issues action and route for customer appointments

This commit is contained in:
ricky committed 2026-08-09 21:45:11 -04:00
1 parent 78d1986493
commit 68425e690a
2 files changed
+14

No files matched your search

@@ -25,6 +25,19 @@ class CustomerAppointmentsController < ApplicationController
}
end
def create_issues
@appointment = CustomerAppointment.find(params[:id])
created_issues = @appointment.create_issues_from_labor_lines(project: @project, author: User.current)
if created_issues.any?
flash[:notice] = l(:notice_successful_create)
redirect_to project_customer_appointments_path(@project)
else
flash[:error] = l(:error_no_labor_lines_found)
redirect_to customer_appointment_path(@appointment)
end
end
def index
if params[:project_id]
@project = Project.find(params[:project_id])
+1
View File
@@ -13,6 +13,7 @@ RedmineApp::Application.routes.draw do
resources :customer_appointments do
collection do
get :customer_options
get :create_issues
end
end