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

Add an option to force metafield data when uploading a file #1703

Closed
jase-languasco opened this issue Jun 30, 2019 · 3 comments
Closed

Add an option to force metafield data when uploading a file #1703

jase-languasco opened this issue Jun 30, 2019 · 3 comments
Assignees
Labels

Comments

@jase-languasco
Copy link

I would like to see an option that forces the metafield data to be entered when uploading a file.

@goto-bus-stop
Copy link
Contributor

You can use onBeforeUpload to do something like this:

const uppy = Uppy({
  onBeforeUpload (files) {
    for (const [key, file] of Object.entries(files)) {
      if (!file.meta.caption) {
        uppyDashboard.info('File is missing caption', 'error')
        throw new Error('File is missing caption')
      }
    }
  }
})

Not perfect but the best we have at the moment; we could add a restrictions.requiredMeta: ['array', 'of', 'names'] kinda option in the future

@goto-bus-stop goto-bus-stop added Core and removed Triage labels Jul 1, 2019
@arturi arturi self-assigned this Jul 5, 2019
@jase-languasco
Copy link
Author

This got the job done! Thanks!

@arturi
Copy link
Contributor

arturi commented Aug 30, 2019

Adding a todo to the backlog and Renee’s comment to the docs! Thanks.

@arturi arturi closed this as completed Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants