Skip to content

Commit

Permalink
#1599 Character Search (#1600)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalcyonJAC authored Apr 5, 2022
1 parent d403d65 commit c912f0c
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/views/Exercise/Reports/CharacterIssues.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@
:data="applicationRecords"
:columns="tableColumns"
:page-size="10"
:custom-search="{
placeholder: 'Search candidate names',
handler: candidateSearch,
field: 'candidate.id',
}"
@change="getTableData"
>
<template #row="{row}">
Expand Down Expand Up @@ -296,14 +301,21 @@ export default {
localParams.orderBy = 'documentId';
}
firestoreRef = tableQuery(this.applicationRecords, firestoreRef, localParams);
this.unsubscribe = firestoreRef
.onSnapshot((snap) => {
const applicationRecords = [];
snap.forEach((doc) => {
applicationRecords.push(vuexfireSerialize(doc));
if (firestoreRef) {
this.unsubscribe = firestoreRef
.onSnapshot((snap) => {
const applicationRecords = [];
snap.forEach((doc) => {
applicationRecords.push(vuexfireSerialize(doc));
});
this.applicationRecords = applicationRecords;
});
this.applicationRecords = applicationRecords;
});
} else {
this.applicationRecords = [];
}
},
async candidateSearch(searchTerm) {
return await this.$store.dispatch('candidates/search', { searchTerm: searchTerm });
},
},
};
Expand Down

0 comments on commit c912f0c

Please sign in to comment.