Add FormData support for http utility

This commit is contained in:
Mulia Nasution
2023-06-06 08:22:22 +07:00
parent 236765a837
commit 52e7da24c1
3 changed files with 10 additions and 9 deletions

View File

@@ -99,10 +99,7 @@ export default {
console.log(this.uploadUrl, 'this.uploadUrl')
fetch(this.uploadUrl, {
method: 'POST',
body: formData,
})
http.post(this.uploadUrl, formData)
.then((res) => res.json())
.then((json) => {
console.log(json)

View File

@@ -108,10 +108,7 @@ export default {
formData.append('keterangan', form.keterangan.value);
formData.append('file', file);
fetch(this.uploadUrl, {
method: 'POST',
body: formData,
})
http.post(this.uploadUrl, formData)
.then((res) => res.json())
.then((json) => {
console.log(json)