Skip to content
Snippets Groups Projects
Commit 4e43d1ab authored by Henrik Askjer's avatar Henrik Askjer
Browse files

Get article ids after selecting

parent 6f3c1244
No related branches found
No related tags found
No related merge requests found
...@@ -67,15 +67,19 @@ ...@@ -67,15 +67,19 @@
if (typeof item != 'string') { if (typeof item != 'string') {
this.items = [] this.items = []
this.suggesting = false this.suggesting = false
if (item.article_promise) {
item.article_promise.then((response) => {
item.article_ids = response.data if (item.match) {
this.submit(item) let self = this
self.api.get('articles?', {params: {lord: item.match}}).then((response) => {
item.article_ids = response.data
self.submit(item)
}) })
} } else {
else { console.log(item)
this.submit(item) this.submit(item)
} }
} }
// If blurred // If blurred
else { else {
...@@ -105,9 +109,6 @@ ...@@ -105,9 +109,6 @@
response.data.forEach((item, i) => { response.data.forEach((item, i) => {
let match = item[0] let match = item[0]
let hit = {q: q, match: match, label: match, time: time} let hit = {q: q, match: match, label: match, time: time}
hit.article_promise = self.api.get('articles?', {params: {lord: match}})
hit.lang = item[1] hit.lang = item[1]
hits.push(hit) hits.push(hit)
......
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