Skip to content

Commit

Permalink
export correct title section (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danble authored Feb 5, 2025
1 parent 764787d commit a6ec985
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/site/src/routes/admin/dictionaries/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<Button
form="filled"
color="black"
onclick={async () => await exportAdminDictionariesAsCSV(filteredDictionaries)}>
onclick={async () => await exportAdminDictionariesAsCSV(filteredDictionaries, active_section)}>
<i class="fas fa-download mr-1" />
Download {filteredDictionaries.length} Dictionaries as CSV
</Button>
Expand Down
4 changes: 2 additions & 2 deletions packages/site/src/routes/admin/dictionaries/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type AdminDictionaryForCSV = {

const admin_headers: AdminDictionaryForCSV = { ...AdminDictionaryCSVFields }

export async function exportAdminDictionariesAsCSV(dictionariesAndHelpers: DictionaryWithHelperStores[]) {
export async function exportAdminDictionariesAsCSV(dictionariesAndHelpers: DictionaryWithHelperStores[], section: 'public' | 'private' | 'other') {
const dictionaries = await getAllDictionariesAndHelpers(dictionariesAndHelpers)

const formatted_dictionaries: (StandardDictionaryForCSV & AdminDictionaryForCSV)[] = dictionaries.map((dictionary) => {
Expand Down Expand Up @@ -58,7 +58,7 @@ export async function exportAdminDictionariesAsCSV(dictionariesAndHelpers: Dicti
downloadObjectsAsCSV(
{ ...standard_headers, ...admin_headers },
formatted_dictionaries,
'living-dictionaries-public-private',
`living-dictionaries-${section}`,
)
}

Expand Down

0 comments on commit a6ec985

Please sign in to comment.