Skip to content
Snippets Groups Projects
Commit aaec128b authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

fjernet "alt"-valget

parent daf26655
No related branches found
No related tags found
No related merge requests found
...@@ -147,15 +147,15 @@ export default { ...@@ -147,15 +147,15 @@ export default {
return new Promise(resolve => { return new Promise(resolve => {
return axios.get(self.api_pref + 'suggest?q=' + q).then( return axios.get(self.api_pref + 'suggest?q=' + q).then(
function(response) { function(response) {
let hits = q.length ? [{q: q, label: q + ' (alt)'}] : [] let hits = []
response.data.forEach((item, i) => { response.data.forEach((item, i) => {
if (hits[0].label != item.match) { if (! hits[0] || hits[0].label != item.match) {
hits.splice(0, 0, {q: q, label: item.match, articles: []}) hits.splice(0, 0, {q: q, label: item.match, articles: []})
} }
hits[0].articles.push(item) hits[0].articles.push(item)
}); });
hits.reverse() hits.reverse()
resolve(hits) resolve(hits.slice(0, 10))
}) })
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment