@@ -19,7 +19,7 @@ def index
1919 @school_students = result [ :school_students ]
2020 render :index , formats : [ :json ] , status : :ok
2121 else
22- render json : { error : result [ :error ] } , status : :unprocessable_entity
22+ render json : { error : result [ :error ] } , status : :unprocessable_content
2323 end
2424 end
2525
@@ -31,7 +31,7 @@ def create
3131 if result . success?
3232 head :no_content
3333 else
34- render json : { error : result [ :error ] } , status : :unprocessable_entity
34+ render json : { error : result [ :error ] } , status : :unprocessable_content
3535 end
3636 end
3737
@@ -41,7 +41,7 @@ def create_batch
4141 error : StandardError ,
4242 error_type : :unprocessable_entity
4343 } ,
44- status : :unprocessable_entity
44+ status : :unprocessable_content
4545 return
4646 end
4747
@@ -57,7 +57,7 @@ def create_batch
5757 render json : {
5858 error : validation_result [ :error ] ,
5959 error_type : validation_result [ :error_type ]
60- } , status : :unprocessable_entity
60+ } , status : :unprocessable_content
6161 return
6262 end
6363
@@ -66,7 +66,7 @@ def create_batch
6666 enqueue_batches ( students )
6767 rescue StandardError => e
6868 Rails . logger . error "Failed to enqueue GoodJob Batch: #{ e } "
69- render json : { error : e , error_type : :batch_error } , status : :unprocessable_entity
69+ render json : { error : e , error_type : :batch_error } , status : :unprocessable_content
7070 return
7171 end
7272
@@ -105,7 +105,7 @@ def update
105105 if result . success?
106106 head :no_content
107107 else
108- render json : { error : result [ :error ] } , status : :unprocessable_entity
108+ render json : { error : result [ :error ] } , status : :unprocessable_content
109109 end
110110 end
111111
@@ -133,7 +133,7 @@ def destroy_batch
133133 error : 'No student IDs provided' ,
134134 error_type : :unprocessable_entity
135135 } ,
136- status : :unprocessable_entity
136+ status : :unprocessable_content
137137 return
138138 end
139139
0 commit comments