Skip to content

Commit

Permalink
fix total_count for researchers. #258
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 15, 2019
1 parent d53f976 commit 5cc01e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ResearcherDatasetConnectionWithMetaType < GraphQL::Types::Relay::BaseConne
field :total_count, Integer, null: false

def total_count
Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Dataset-Person").dig(:meta, "total").to_i
Event.query(nil, obj_id: https_to_http(object.parent[:id]), citation_type: "Dataset-Person").dig(:meta, "total").to_i
end

def https_to_http(url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ResearcherPublicationConnectionWithMetaType < GraphQL::Types::Relay::BaseC
field :total_count, Integer, null: false

def total_count
Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "JournalArticle-Person").dig(:meta, "total").to_i
Event.query(nil, obj_id: https_to_http(object.parent[:id]), citation_type: "JournalArticle-Person").dig(:meta, "total").to_i
end

def https_to_http(url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ResearcherSoftwareConnectionWithMetaType < GraphQL::Types::Relay::BaseConn
field :total_count, Integer, null: false

def total_count
Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Person-SoftwareSourceCode").dig(:meta, "total").to_i
Event.query(nil, obj_id: https_to_http(object.parent[:id]), citation_type: "Person-SoftwareSourceCode").dig(:meta, "total").to_i
end

def https_to_http(url)
Expand Down

0 comments on commit 5cc01e5

Please sign in to comment.