feat : add getExportUrl to time-entries service and i18n key
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,5 +50,23 @@ export function useTimeEntryService() {
|
||||
})
|
||||
}
|
||||
|
||||
return { getByDateRange, getActive, create, update, remove }
|
||||
function getExportUrl(params: {
|
||||
after: string
|
||||
before: string
|
||||
user?: number
|
||||
project?: number
|
||||
tags?: number[]
|
||||
}): string {
|
||||
const query = new URLSearchParams()
|
||||
query.set('after', params.after)
|
||||
query.set('before', params.before)
|
||||
if (params.user) query.set('user', String(params.user))
|
||||
if (params.project) query.set('project', String(params.project))
|
||||
if (params.tags?.length) {
|
||||
params.tags.forEach(id => query.append('tags[]', String(id)))
|
||||
}
|
||||
return `/api/time_entries/export?${query.toString()}`
|
||||
}
|
||||
|
||||
return { getByDateRange, getActive, create, update, remove, getExportUrl }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user