This commit is contained in:
2020-04-09 16:38:26 +00:00
parent f2e8e34cdb
commit 8e06072204
2 changed files with 25 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ CURRENT TODOs
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: 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: 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

View File

@@ -168,10 +168,33 @@ export default {
});
},
getExcerpt(item) {
let vm = this;
//Search/Info/2/1?phrase=we
if (item.info) {
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() {
let vm = this;