Skip to content

Commit

Permalink
remove database from goodreads module
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewilkinson committed Jan 24, 2024
1 parent 308d6cf commit 25ef8d8
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/goodreads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module Goodreads
HOST = 'www.goodreads.com'
BASE_URL = "https://#{HOST}"
GOODREADS_SECRET = ENV.fetch 'GOODREADS_SECRET'
USERS = DB[:users]
BOOK_DETAILS = %w[isbn book/image_url title authors/author/name published rating].freeze

module_function
Expand Down Expand Up @@ -116,11 +115,6 @@ def fetch_user request_token
user_id = xml.xpath('//user').first.attributes.first[1].value
name = xml.xpath('//user').first.children[1].children.text

if USERS.first(goodreads_user_id: user_id)
USERS.where(goodreads_user_id: user_id).update(access_token: access_token.token, access_token_secret: access_token.secret)
else
USERS.insert(first_name: name, goodreads_user_id: user_id, access_token: access_token.token, access_token_secret: access_token.secret)
end
user_id
end

Expand Down

0 comments on commit 25ef8d8

Please sign in to comment.