|
@@ -137,7 +137,12 @@ const upload = require('multer')({ dest: uploadPath })
|
|
|
|
|
|
let {models: {Image }} = await getModels(decoded.sub)
|
|
let {models: {Image }} = await getModels(decoded.sub)
|
|
let image = await Image.fromFileData(req.file)
|
|
let image = await Image.fromFileData(req.file)
|
|
- res.end(JSON.stringify({_id: image._id, url: image.url}))
|
|
|
|
|
|
+ if (image){
|
|
|
|
+ res.end(JSON.stringify({_id: image._id, url: image.url}))
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ res.end('YAKAS CHUHNYA')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
res.status(503).send('permission denied')
|
|
res.status(503).send('permission denied')
|