Skip to content

Commit

Permalink
Revert "send language from book to salesforce"
Browse files Browse the repository at this point in the history
This reverts commit c4891fd.
  • Loading branch information
mwvolo committed Nov 7, 2024
1 parent c4891fd commit fd2834f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
5 changes: 2 additions & 3 deletions app/handlers/newflow/educator_signup/complete_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ def books_used
end

def books_used_details
puts signup_params[:books_used_details]
signup_params[:books_used_details].to_h.select do |_, v|
v['how_using_book'].present? && v['num_students_using_book'].present?
(signup_params.books_used_details || {}).reject do |k, v|
k.blank? || v.dig('how_using_book').blank? || v.dig('num_students_using_book').blank?
end
end

Expand Down
17 changes: 2 additions & 15 deletions app/routines/newflow/create_or_update_salesforce_lead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,11 @@ def build_book_adoption_json_for_salesforce(user)
return nil unless user.books_used_details

user.books_used_details.each do |book|

book_value = book[0]
if book_value.match(/\[.*\]/)
book_name = book_value.gsub(/\[.*\]/, '').strip # Calculus Volume 1
book_language = book_value[/\[(.*?)\]/, 1] # Spanish (no brackets)
books_json << {
name: book_name,
students: book[1]["num_students_using_book"],
howUsing: book[1]["how_using_book"],
language: book_language,
}
else
books_json << {
name: book_value,
books_json << {
name: book[0],
students: book[1]["num_students_using_book"],
howUsing: book[1]["how_using_book"]
}
end
end

adoption_json['Books'] = books_json
Expand Down

0 comments on commit fd2834f

Please sign in to comment.