Skip to content

Commit

Permalink
Merge pull request #148 from bcgov/scdicontact
Browse files Browse the repository at this point in the history
fixed contact date filters
  • Loading branch information
suzalflueck authored Jan 8, 2024
2 parents 069d690 + 23489df commit dd2ccca
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions frontend/src/views/ContactsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const dialog = ref(false)
const filteredContacts = ref([])
const selectedContactType = ref(null)
const results = ref(0)
const itemsPerPage = ref(100)
const itemsPerPage = ref(4000)
const itemsSort = ref('')
const totalPages = ref(1)
const headers = [
Expand Down Expand Up @@ -63,18 +63,54 @@ const searchContact = async () => {
}
]
if (selectedContactType.value) {
params[0].searchCriteriaList.push({
key: 'expiryDate',
operation: 'eq',
value: null,
valueType: 'STRING',
condition: 'OR'
})
params[0].searchCriteriaList.push({
key: 'expiryDate',
operation: 'gte',
value: currentDate,
valueType: 'DATE_TIME',
condition: 'OR'
})
params[0].searchCriteriaList.push({
key: 'effectiveDate',
operation: 'lte',
value: currentDate,
valueType: 'DATE_TIME',
condition: 'AND'
})
params[0].searchCriteriaList.push({
key: 'districtContactTypeCode',
operation: 'eq',
value: selectedContactType.value,
valueType: 'STRING',
condition: 'AND'
})
} else {
params[0].searchCriteriaList.push({
key: 'expiryDate',
operation: 'eq',
value: null,
valueType: 'STRING',
condition: 'OR'
})
params[0].searchCriteriaList.push({
key: 'expiryDate',
operation: 'gte',
value: currentDate,
valueType: 'DATE_TIME',
condition: 'OR'
})
params[0].searchCriteriaList.push({
key: 'effectiveDate',
operation: 'lte',
value: currentDate,
valueType: 'DATE_TIME',
condition: 'AND'
})
}
Expand Down Expand Up @@ -151,14 +187,16 @@ onMounted(() => {
>
</v-col>
</v-row>
<v-data-table-virtual
<v-data-table
:headers="headers"
:items="filteredContacts"
:items-per-page="-1"
class="elevation-1"
height="700"
item-value="name"
dense
:sort-by="[{ key: 'districtNumber', order: 'asc' }]"
></v-data-table-virtual>
></v-data-table>
</v-container>
</div>
</template>
Expand Down

0 comments on commit dd2ccca

Please sign in to comment.