fix devices

This commit is contained in:
Emily
2024-10-08 15:31:45 +02:00
parent 62c72b3ff9
commit b73155a176
2 changed files with 11 additions and 6 deletions

2
TODO
View File

@@ -2,11 +2,9 @@
- Reactivity on project delete (update dropdown) + test guest
- Devices remove empty (Fix devices Dashboard card, replace empty with "unkwnwn")
- docs vertical navigation not wfull
- project creation
- Event funnel / metadata analyzer / user flow
- Test guest actions
- Refactor UI Data analyst
- Remove Top Events from web analytics and move to custom events (with raw data access)
- Fix email on plan upgrade and resub

View File

@@ -1,8 +1,14 @@
<script lang="ts" setup>
function transform(data: { _id: string, count: number }[]) {
console.log(data);
return data.map(e => ({ ...e, _id: e._id == null ? 'unknown' : e._id }))
}
const devicesData = useFetch('/api/data/devices', {
headers: useComputedHeaders({ limit: 10, }), lazy: true
headers: useComputedHeaders({ limit: 10, }), lazy: true,
transform
});
const { showDialog, dialogBarData, isDataLoading } = useBarCardDialog();
@@ -13,10 +19,11 @@ async function showMore() {
isDataLoading.value = true;
const res = await $fetch('/api/data/devices', {
headers: useComputedHeaders({ limit: 1000 }).value
headers: useComputedHeaders({ limit: 1000 }).value,
});
dialogBarData.value = res || [];
dialogBarData.value = transform(res || []);
isDataLoading.value = false;