Skip to content

Commit

Permalink
Add support for source_locations field
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahwcodes committed Oct 24, 2024
1 parent 5efc44d commit 80a3a3b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/va_notify/lib/va_notify/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def create_notification(response)
raise Common::Exceptions::BackendServiceException, notification if response.nil?

notification = VANotify::Notification.new(
notification_id: response['id']
notification_id: response['id'],
source_location: find_caller_locations
)

if notification.save
Expand All @@ -103,5 +104,11 @@ def create_notification(response)
raise Common::Exceptions::ValidationErrors, notification
end
end

def find_caller_locations
caller_locations(1,1).map do |location|

Check failure on line 109 in modules/va_notify/lib/va_notify/service.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Layout/SpaceAfterComma: Space missing after comma.
"#{location.path}:#{location.lineno} in #{location.label}"
end
end
end
end

0 comments on commit 80a3a3b

Please sign in to comment.