-
Notifications
You must be signed in to change notification settings - Fork 909
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
create a account-archived page on web for archived users to export data #4355
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
try { | ||
// Make a GET request to the /export endpoint | ||
const response = await fetch('/api/export', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if they click this multiple times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two cases:
- If the export task is running, clicking this multiple times won't create multiple tasks and just return
200
. Probably we should return202
instead - If the export tasks is failed/completed, clicking this multiple times will firstly check if the user has exceed the export quota(3 times in a day)
2a. if not exceed, create a new export task
2b. if exceed, failed and return400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
Is there any way in API to get the status of the export?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we can reuse the same export API by providing different status code like 200
or 204
. Alternatively there is a /task/{{id}}
API which could be used to query the status of a task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think probably I will just reuse the /export
API and use the status code and state in the response
No description provided.