sdk improvement and get profile with events

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-11 23:26:30 +01:00
parent 85e4922dc3
commit 6f2aeffdff
8 changed files with 86 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ export function EventListItem({
createdAt,
name,
properties,
path,
}: EventListItemProps) {
const params = useAppParams();
@@ -46,16 +47,15 @@ export function EventListItem({
switch (name) {
case 'screen_view': {
const route = (properties?.route || properties?.path)!;
if (route) {
bullets.push(route);
if (path) {
bullets.push(path);
}
break;
}
}
return bullets;
}, [name, createdAt, profile, properties, params]);
}, [name, createdAt, profile, properties, params, path]);
return (
<ExpandableListItem

View File

@@ -12,6 +12,12 @@ const handler = (req: Request) =>
session: auth(),
};
},
onError(opts) {
const { error, type, path, input, ctx, req } = opts;
console.error('---- TRPC ERROR');
console.error('Error:', error);
console.error();
},
});
export { handler as GET, handler as POST };