I wanted to send photo from postman but i had error. How can i solve that?
{
"error": "Unexpected token - in JSON at position 0"
}
My code:
Parse.Cloud.define('test', async (req) => {
try {
const Test = Parse.Object.extend('Test')
const obj = new Test()
const { photo } = req.params
let uploadedFile = await new Parse.File(
'galleryFile',
photo,
'image/png'
)
obj.set('photo', uploadedFile)
const data = await obj.save()
return data
} catch (error) {
throw error
}
})