Skip to content

Commit

Permalink
fix: remove unused ruby calls
Browse files Browse the repository at this point in the history
  • Loading branch information
justiceotuya committed Oct 16, 2023
1 parent 5fc715b commit 7a4df98
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
26 changes: 0 additions & 26 deletions app/assets/javascripts/actions/article_finder_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,32 +257,6 @@ const fetchPageRevisionScore = async (revids, wiki, dispatch) => {
}
};

// const fetchPageRevisionScore = (revids, wiki, dispatch) => {
// const query = pageRevisionScoreQueryGenerator(map(revids, (revid) => {
// return revid.revisions[0].revid;
// }), wiki.project);
// return promiseLimit(4)(() =>
// queryUrl(liftWingApiBase(wiki.language, wiki.project), query)
// )
// .then(
// data =>
// data[
// `${wiki.project === 'wikidata' ? 'wikidata' : wiki.language}wiki`
// ].scores
// )
// .then((data) => {
// dispatch({
// type: RECEIVE_ARTICLE_REVISIONSCORE,
// data: {
// data: data,
// language: wiki.language,
// project: wiki.project,
// },
// });
// })
// .catch(response => dispatch({ type: API_FAIL, data: response }));
// };

export const fetchKeywordResults = (keyword, wiki, offset = 0, continueResults = false) =>
(dispatch, getState) => {
if (!continueResults) {
Expand Down
23 changes: 0 additions & 23 deletions app/controllers/revisions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# frozen_string_literal: true
require 'ostruct'

require_dependency "#{Rails.root}/lib/lift_wing_api"
require_dependency "#{Rails.root}/lib/wiki_api"


#=Controller for the Revisions API.
class RevisionsController < ApplicationController
Expand All @@ -20,22 +15,4 @@ def index
.eager_load(:article, :wiki)
.limit(params[:limit] || DEFAULT_REVISION_LIMIT)
end

def show
revids =JSON.parse(params[:revids]).split("|")
wiki = JSON.parse(params[:wiki])
# convert wiki to object
wiki = OpenStruct.new(wiki)

wiki_key = "#{wiki.language || wiki.project}wiki"
model_key ||= wiki.project == 'wikidata' ? 'itemquality' : 'articlequality'

# convert each revids to integer
revids = revids.map(&:to_i)

# get article quality data
articlequality_data = LiftWingApi.new(wiki, nil).get_revision_data(revids)

render json: articlequality_data, status: 200
end
end
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
constraints: { course_id: /.*/ }

get 'revisions' => 'revisions#index'
get 'revisions/show' => 'revisions#show'

get 'articles/article_data' => 'articles#article_data'
get 'articles/details' => 'articles#details'
Expand Down

0 comments on commit 7a4df98

Please sign in to comment.