From 103c75a1e63c12af75638fd565bcb96969017c79 Mon Sep 17 00:00:00 2001 From: Magdalena Jadach Date: Fri, 30 Aug 2024 16:19:31 +0100 Subject: [PATCH 1/2] Initial --- app/controllers/api/school_students_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/controllers/api/school_students_controller.rb b/app/controllers/api/school_students_controller.rb index be6ac2d5..8e060498 100644 --- a/app/controllers/api/school_students_controller.rb +++ b/app/controllers/api/school_students_controller.rb @@ -44,6 +44,7 @@ def update ) if result.success? + update_student_details(@school) head :no_content else render json: { error: result[:error] }, status: :unprocessable_entity @@ -59,6 +60,7 @@ def destroy render json: { error: result[:error] }, status: :unprocessable_entity end end + private @@ -90,5 +92,15 @@ def create_owner_safeguarding_flag email: current_user.email ) end + + def update_student_details(@school) + ProfileApiClient.update_school_student( + token: current_user.token, + school_id: school.id, + student_id: school_student.id, + name: school_student.name, + username: school_student.username + ) + end end end From 84c7cf9d576fb7631514b37d5660c88ace9afcf1 Mon Sep 17 00:00:00 2001 From: Magdalena Jadach Date: Thu, 5 Sep 2024 13:55:35 +0100 Subject: [PATCH 2/2] reverse changes --- app/controllers/api/school_students_controller.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/controllers/api/school_students_controller.rb b/app/controllers/api/school_students_controller.rb index 8e060498..0b9b8569 100644 --- a/app/controllers/api/school_students_controller.rb +++ b/app/controllers/api/school_students_controller.rb @@ -44,7 +44,6 @@ def update ) if result.success? - update_student_details(@school) head :no_content else render json: { error: result[:error] }, status: :unprocessable_entity @@ -92,15 +91,6 @@ def create_owner_safeguarding_flag email: current_user.email ) end - - def update_student_details(@school) - ProfileApiClient.update_school_student( - token: current_user.token, - school_id: school.id, - student_id: school_student.id, - name: school_student.name, - username: school_student.username - ) - end + end end