13 lines
271 B
JavaScript
13 lines
271 B
JavaScript
const m = require('mithril')
|
|
const { sendRequest } = require('./common')
|
|
|
|
exports.uploadMedia = function(file) {
|
|
let formData = new FormData()
|
|
formData.append('file', file)
|
|
|
|
return sendRequest({
|
|
method: 'POST',
|
|
url: '/api/media',
|
|
body: formData,
|
|
})
|
|
}
|