This commit is contained in:
@@ -51,6 +51,7 @@ export default {
|
||||
endpoint,
|
||||
fieldName: 'files[]',
|
||||
formData: true,
|
||||
headers: {'X-CSRF-Token': this.consts.csrf_token},
|
||||
allowedMetaFields: ['t', 'name', 'type'],
|
||||
getResponseData(xhr) {
|
||||
return JSON.parse(xhr.responseText || '{}');
|
||||
@@ -65,7 +66,7 @@ export default {
|
||||
const uploadedFiles = response?.body?.files || [];
|
||||
uploadedFiles.forEach((uploadedFile) => {
|
||||
const hasError = Object.prototype.hasOwnProperty.call(uploadedFile, 'error');
|
||||
this.logs.push(hasError ? uploadedFile.error : this.lang.get('upload.success', [uploadedFile.name]));
|
||||
this.logs.push(hasError ? uploadedFile.error : this.lang.get('upload.success', [uploadedFile.original_name || uploadedFile.name]));
|
||||
if(!hasError) this.files.push({...uploadedFile, content: ''});
|
||||
});
|
||||
});
|
||||
@@ -85,7 +86,7 @@ export default {
|
||||
event.target.value = '';
|
||||
},
|
||||
addComment(oFile) {
|
||||
this.api.get('add_comment', {
|
||||
this.api.post('add_comment', {
|
||||
id: oFile.id,
|
||||
content: oFile.content
|
||||
})
|
||||
@@ -98,7 +99,7 @@ export default {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
this.logs.push('Sending position...');
|
||||
this.api.get('add_position', {
|
||||
this.api.post('add_position', {
|
||||
'latitude': position.coords.latitude,
|
||||
'longitude': position.coords.longitude,
|
||||
'timestamp': Math.round(position.timestamp / 1000)
|
||||
|
||||
Reference in New Issue
Block a user