Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate Api::ServiceTemplateWorkflow service #14501

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/api/service_orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def service_request_workflow(service_request)
raise BadRequestError, "Must specify a service_template_href for adding a service_request"
end
service_template = resource_search(service_template_id, :service_templates, ServiceTemplate)
ServiceTemplateWorkflow.create(service_template, service_request)
service_template.provision_workflow(User.current_user, service_request)
end

def check_validation(validation)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/subcollections/service_templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def service_templates_unassign_resource(object, type, id = nil, _data = nil)
def service_templates_order_resource(_object, type, id = nil, data = nil)
klass = collection_class(:service_templates)
service_template = resource_search(id, type, klass)
workflow = ServiceTemplateWorkflow.create(service_template, data || {})
workflow = service_template.provision_workflow(User.current_user, data || {})
request_result = workflow.submit_request
errors = request_result[:errors]
if errors.present?
Expand Down
10 changes: 0 additions & 10 deletions lib/services/api/service_template_workflow.rb

This file was deleted.

31 changes: 0 additions & 31 deletions spec/lib/services/api/service_template_workflow_spec.rb

This file was deleted.