Removed json response

This commit is contained in:
2024-08-13 10:54:26 +02:00
parent ead82a9222
commit 3a660d42de
5 changed files with 0 additions and 14 deletions

View File

@@ -19,10 +19,8 @@ class JobsController < ApplicationController
Turbo::StreamsChannel.broadcast_prepend_later_to "jobs", target: :jobs, partial: "jobs/job_tr", Turbo::StreamsChannel.broadcast_prepend_later_to "jobs", target: :jobs, partial: "jobs/job_tr",
locals: { job: @job } locals: { job: @job }
format.html { redirect_to jobs_url } format.html { redirect_to jobs_url }
format.json { render :show, status: :created, location: @job }
else else
format.html { render :new, status: :unprocessable_entity } format.html { render :new, status: :unprocessable_entity }
format.json { render json: @job.errors, status: :unprocessable_entity }
end end
end end
end end
@@ -39,7 +37,6 @@ class JobsController < ApplicationController
broadcast_update_job broadcast_update_job
format.turbo_stream format.turbo_stream
format.html { redirect_to jobs_url } format.html { redirect_to jobs_url }
format.json { head :no_content }
end end
end end

View File

@@ -11,7 +11,6 @@ class Operator::JobsController < ApplicationController
@paidcanceledjobs = Job.paidcanceled.status_changed_today.order(:status_changed_at) @paidcanceledjobs = Job.paidcanceled.status_changed_today.order(:status_changed_at)
end end
# GET /jobs/1 or /jobs/1.json # GET /jobs/1 or /jobs/1.json
def show; end def show; end
@@ -33,10 +32,8 @@ class Operator::JobsController < ApplicationController
Turbo::StreamsChannel.broadcast_prepend_later_to "jobs", target: :jobs, partial: "jobs/job_tr", Turbo::StreamsChannel.broadcast_prepend_later_to "jobs", target: :jobs, partial: "jobs/job_tr",
locals: { job: @job } locals: { job: @job }
format.html { redirect_to jobs_url } format.html { redirect_to jobs_url }
format.json { render :show, status: :created, location: @job }
else else
format.html { render :new, status: :unprocessable_entity } format.html { render :new, status: :unprocessable_entity }
format.json { render json: @job.errors, status: :unprocessable_entity }
end end
end end
end end
@@ -47,10 +44,8 @@ class Operator::JobsController < ApplicationController
if @job.update(job_params) if @job.update(job_params)
broadcast_update_job broadcast_update_job
format.html { redirect_to jobs_url, notice: "Job was successfully updated." } format.html { redirect_to jobs_url, notice: "Job was successfully updated." }
format.json { render :show, status: :ok, location: @job }
else else
format.html { render :edit, status: :unprocessable_entity } format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @job.errors, status: :unprocessable_entity }
end end
end end
end end
@@ -66,7 +61,6 @@ class Operator::JobsController < ApplicationController
broadcast_update_job broadcast_update_job
format.turbo_stream format.turbo_stream
format.html { redirect_to jobs_url } format.html { redirect_to jobs_url }
format.json { head :no_content }
end end
end end
@@ -77,7 +71,6 @@ class Operator::JobsController < ApplicationController
respond_to do |format| respond_to do |format|
Turbo::StreamsChannel.broadcast_remove_to "jobs", target: @job Turbo::StreamsChannel.broadcast_remove_to "jobs", target: @job
format.html { redirect_to jobs_url, notice: "Job was successfully destroyed." } format.html { redirect_to jobs_url, notice: "Job was successfully destroyed." }
format.json { head :no_content }
end end
end end

View File

@@ -1 +0,0 @@
json.array! @jobs, partial: "jobs/job", as: :job

View File

@@ -1,2 +0,0 @@
json.extract! job, :id, :operator_id, :costumer_id, :operator_firstname, :operator_lastname, :costumer_firstname, :costumer_lastname, :paid, :printed_at, :intern, :cost_center, :number_of_plans_a0, :number_of_plans_a1, :number_of_plans_a2, :number_of_plans_a3, :costum_qm_plan, :created_at, :updated_at
json.url job_url(job, format: :json)

View File

@@ -1 +0,0 @@
json.partial! "jobs/job", job: @job