Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pickFiles () {
robodog.pick({
waitForEncoding: true,
params: {
auth: { key: TRANSLOADIT_EXAMPLE_KEY },
template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
}
}).then((result) => {
// Was cancelled
if (result == null) return
this.insertAttachments(
this.matchFilesAndThumbs(result.results)
)
}).catch((err) => {
console.error(err)
this.reportUploadError(err)
})
}
function openModal () {
robodog.pick({
restrictions: {
allowedFileTypes: ['.png']
},
waitForEncoding: true,
params: {
auth: { key: TRANSLOADIT_KEY },
template_id: TEMPLATE_ID
},
providers: [
'webcam'
]
// if providers need custom config
// webcam: {
// option: 'whatever'
// }
}).then(console.log, console.error)
pickFiles () {
robodog.pick({
waitForEncoding: true,
params: {
auth: { key: TRANSLOADIT_EXAMPLE_KEY },
template_id: TRANSLOADIT_EXAMPLE_TEMPLATE
},
providers: [
'webcam',
'url',
'instagram',
'google-drive',
'dropbox'
]
}).then((result) => {
if (result === null) return
this.insertAttachments(
this.matchFilesAndThumbs(result.results)