nfp_sites/nfp_moe/app/api/media.js
2022-08-02 08:00:57 +00:00

17 lines
326 B
JavaScript

const common = require('./common')
exports.uploadMedia = function(file, height) {
let formData = new FormData()
formData.append('file', file)
let extra = ''
if (height) {
extra = '?height=' + height
}
return common.sendRequest({
method: 'POST',
url: '/api/media' + extra,
body: formData,
})
}