Skip to content

Commit

Permalink
fix: events return type
Browse files Browse the repository at this point in the history
  • Loading branch information
justkahdri committed Dec 16, 2024
1 parent b8b1215 commit b612147
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions packages/basehub/src/events/primitive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type TableResponse<
type TimeSeriesResponse =
| {
success: true;
data: Array<{ count: number; date: string }>;
data: Array<{ count: number; label: string }>;
}
| {
success: false;
Expand Down Expand Up @@ -220,21 +220,7 @@ export async function getEvents<Key extends `${EventKeys}:${string}`>(
headers: { "Content-Type": "application/json" },
});

const data = (await response.json()) as
| {
success: true;
data: {
count: number;
label: string;
}[];
}
| {
code: number;
success: false;
error: string;
};

return data;
return (await response.json()) as TimeSeriesResponse;
}
}

Expand Down

0 comments on commit b612147

Please sign in to comment.