Skip to content

Commit

Permalink
Merge pull request #207 from bcgov/SC3683
Browse files Browse the repository at this point in the history
Fix sorting order using updated date
  • Loading branch information
TimCsaky authored May 31, 2024
2 parents ec89a9f + 97c9b86 commit 8fd0c09
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/components/object/ObjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ const loadLazyData = (event?: any) => {
lazyParams.value?.filters?.meta.value //Header
)
.then((r: any) => {
tableData.value = r.data;
tableData.value = r.data.map((item: any) => ({
...item,
updatedAt: item.updatedAt === null ? item.createdAt : item.updatedAt
}));
totalRecords.value = +r?.headers['x-total-rows'];
// add objects to store
objectStore.setObjects(r.data);
Expand All @@ -125,7 +128,7 @@ const loadLazyData = (event?: any) => {
})
// add object permissions to store
.then((objects: Array<COMSObjectDataSource>) => {
if(objects.length > 0) {
if (objects.length > 0) {
permissionStore.fetchObjectPermissions({ objectId: objects.map((o: COMSObject) => o.id) });
}
});
Expand Down Expand Up @@ -294,7 +297,7 @@ const selectedFilters = (payload: any) => {
sortable
>
<template #body="{ data }">
{{ formatDateLong(data.updatedAt ?? data.createdAt) }}
{{ formatDateLong(data.updatedAt) }}
</template>
</Column>
<Column
Expand Down

0 comments on commit 8fd0c09

Please sign in to comment.