nfp_sites/app/api/file.js

13 lines
276 B
JavaScript
Raw Normal View History

2019-10-01 11:35:00 +00:00
const common = require('./common')
2019-09-14 19:03:38 +00:00
exports.uploadFile = function(articleId, file) {
let formData = new FormData()
formData.append('file', file)
2019-10-01 11:35:00 +00:00
return common.sendRequest({
2019-09-14 19:03:38 +00:00
method: 'POST',
url: '/api/articles/' + articleId + '/file',
body: formData,
})
}