Skip to content

Commit

Permalink
Replace updatedAt if its null
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindersingh93 committed May 31, 2024
1 parent ec89a9f commit 171677a
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 }) => ({
...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 171677a

Please sign in to comment.