Saves the API response to a file. csv, json, xml, yaml.
hermesalvesbr opened this issue · 3 comments
hermesalvesbr commented
?export=csv
?export=json
?export=xml
?export=yaml
I need to make an export button that picks up the directus export options, is there any way to do this using your api? Because the collections are private and I would like to use the current session.
Thanks for your module!
hermesalvesbr commented
async exportData() {
try {
const data = await this.directus.getItems({
collection: 'edicao',
params: {
export: 'csv',
sort: '-date_created',
limit: 10,
} as ExtendedDirectusQueryParams,
})
// console.log(data)
return data
} catch (e: any) {
throw new Error('Connection failed', e.message)
}
}
This function, return undefined
Intevel commented
Currently this doesn't work, I can add this feature in the next days.
hermesalvesbr commented
Thanks