mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-21 18:44:57 +00:00
cleanup: use Period type instead of inline union in renderDashboard
This commit is contained in:
parent
bbaf71431d
commit
efab93e78e
2 changed files with 2 additions and 2 deletions
|
|
@ -44,7 +44,7 @@ function getDateRange(period: string): { range: DateRange; label: string } {
|
|||
}
|
||||
}
|
||||
|
||||
function toPeriod(s: string): 'today' | 'week' | 'month' | '30days' {
|
||||
function toPeriod(s: string): 'today' | 'week' | '30days' | 'month' {
|
||||
if (s === 'today') return 'today'
|
||||
if (s === 'month') return 'month'
|
||||
if (s === '30days') return '30days'
|
||||
|
|
|
|||
|
|
@ -571,7 +571,7 @@ function StaticDashboard({ projects, period }: { projects: ProjectSummary[]; per
|
|||
)
|
||||
}
|
||||
|
||||
export async function renderDashboard(period: 'today' | 'week' | 'month' | '30days' = 'week', provider: string = 'all'): Promise<void> {
|
||||
export async function renderDashboard(period: Period = 'week', provider: string = 'all'): Promise<void> {
|
||||
await loadPricing()
|
||||
const range = getDateRange(period)
|
||||
const projects = await parseAllSessions(range, provider)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue