Move magic number to config instead

This commit is contained in:
Maximilian Grundke
2018-10-05 14:55:22 +02:00
parent fad97e36c1
commit 174db96081
2 changed files with 6 additions and 3 deletions

View File

@ -26,12 +26,12 @@ CodeOceanEditorFlowr = {
var stackoverflowRequests = _.map(insights, function (insight) {
var queryParams = {
accepted: true,
pagesize: 3,
pagesize: <%= CodeOcean::Config.new(:code_ocean).read[:flowr][:answers_per_query] %>,
order: 'desc',
sort: 'relevance',
site: 'stackoverflow',
answers: 1,
filter: '!23qca9v**HCO.ESF)dHfT',
filter: '!23qca9v**HCO.ESF)dHfT', // title, body, accepted answer
q: insight.query
}
@ -87,7 +87,8 @@ CodeOceanEditorFlowr = {
this.getInsights().then(function () {
var results = self.collectResults(arguments);
_.each(results, function (result, index) {
var collapsibleTileHtml = self.flowrResultHtml.replace(/{{collapseId}}/g, 'collapse-' + index).replace(/{{headingId}}/g, 'heading-' + index);
var collapsibleTileHtml = self.flowrResultHtml
.replace(/{{collapseId}}/g, 'collapse-' + index).replace(/{{headingId}}/g, 'heading-' + index);
var resultTile = $(collapsibleTileHtml);
var questionUrl = 'https://stackoverflow.com/questions/' + result.question_id;