This commit is contained in:
@@ -52,6 +52,7 @@ CURRENT TODOs
|
|||||||
|
|
||||||
todo: excerpt, add as part of item object and conditionally show
|
todo: excerpt, add as part of item object and conditionally show
|
||||||
todo: search controller at server needs an excerpt route so client can request an excerpt for a record
|
todo: search controller at server needs an excerpt route so client can request an excerpt for a record
|
||||||
|
todo: add integration test for search controller get excerpt route
|
||||||
todo: session cache search results and scroll position if possible to support "back and forthing"
|
todo: session cache search results and scroll position if possible to support "back and forthing"
|
||||||
todo: search what order should the results be retruned in, right now is by id but looks weird in list
|
todo: search what order should the results be retruned in, right now is by id but looks weird in list
|
||||||
todo: look at using finally block in all fetch form calls to do the things that are repeated in catch and then above it see search form for example
|
todo: look at using finally block in all fetch form calls to do the things that are repeated in catch and then above it see search form for example
|
||||||
|
|||||||
@@ -168,10 +168,33 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getExcerpt(item) {
|
getExcerpt(item) {
|
||||||
|
let vm = this;
|
||||||
|
//Search/Info/2/1?phrase=we
|
||||||
if (item.info) {
|
if (item.info) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// item.info = "***NEW INFO HERE****";
|
|
||||||
|
window.$gz.api
|
||||||
|
.get(
|
||||||
|
API_BASE_URL +
|
||||||
|
item.type +
|
||||||
|
"/" +
|
||||||
|
item.id +
|
||||||
|
"?phrase=" +
|
||||||
|
vm.searchPhrase
|
||||||
|
)
|
||||||
|
|
||||||
|
.then(res => {
|
||||||
|
if (res.error != undefined) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
} else {
|
||||||
|
item.info = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function handleGetDataFromAPIError(error) {
|
||||||
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getDataFromApi() {
|
getDataFromApi() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user