Skip to content

Commit 7139697

Browse files
committed
Changing request to params in controllers
1 parent cf2f2d9 commit 7139697

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app/controllers/class_marker/webhooks_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class ClassMarker::WebhooksController < ApplicationController
44
before_action :verify_hmac_signature
55

66
def assessment
7-
UpdateUserAssessmentAttemptFromClassMarkerJob.perform_later(request[:test][:test_id], request[:result][:cm_user_id], request[:result][:percentage])
7+
UpdateUserAssessmentAttemptFromClassMarkerJob.perform_later(params[:test][:test_id], params[:result][:cm_user_id], params[:result][:percentage])
88
head :ok
99
end
1010

app/controllers/concerns/curriculum/rateable.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def comment
3333
raise NoMethodError unless respond_to?(:client, true)
3434

3535
response = client.update_rating(
36-
id: request[:rating_id],
36+
id: params[:rating_id],
3737
key: :comment,
38-
value: request[:comment].gsub('"', '\"')
38+
value: params[:comment].gsub('"', '\"')
3939
)
4040

4141
render json: {
@@ -48,11 +48,11 @@ def choices
4848
raise NoMethodError unless respond_to?(:client, true)
4949

5050
response = client.update_rating(
51-
id: request[:rating_id],
51+
id: params[:rating_id],
5252
key: :choices,
53-
value: request[:rating_choices]
53+
value: params[:rating_choices]
5454
)
55-
response.rating_id = request[:rating_id]
55+
response.rating_id = params[:rating_id]
5656
render json: {
5757
origin: __method__.to_s,
5858
data: response

app/controllers/dynamics/webhooks_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class WebhooksController < ApplicationController
44
before_action :verify_bearer_token
55

66
def user
7-
stem_achiever_contact_no = request[:stem_achiever_contact_no]&.downcase
7+
stem_achiever_contact_no = params[:stem_achiever_contact_no]&.downcase
88
user = User.find_by(stem_achiever_contact_no:)
99

1010
Sentry.capture_message("Dynamics webhook failed as no user found with contact_no: #{stem_achiever_contact_no || "nil"}") unless user

0 commit comments

Comments
 (0)