Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saves the API response to a file. csv, json, xml, yaml. #191

Open
hermesalvesbr opened this issue Aug 15, 2023 · 3 comments
Open

Saves the API response to a file. csv, json, xml, yaml. #191

hermesalvesbr opened this issue Aug 15, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@hermesalvesbr
Copy link

 ?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 hermesalvesbr added the question Further information is requested label Aug 15, 2023
@hermesalvesbr
Copy link
Author

  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
Copy link
Owner

Intevel commented Aug 17, 2023

Currently this doesn't work, I can add this feature in the next days.

@hermesalvesbr
Copy link
Author

Thanks

@Intevel Intevel added enhancement New feature or request and removed question Further information is requested labels Aug 17, 2023
@Intevel Intevel reopened this Aug 17, 2023
@Intevel Intevel self-assigned this Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants