fixed sanitizeFilename for backend\API,

added new API call attachmentDownload,
fixed attachment URL to call attachmentDownload,
refactoring Report.vue for <script setup>
This commit is contained in:
2025-10-16 01:40:44 +02:00
parent ed3d202488
commit 3e9056f4a6
4 changed files with 225 additions and 169 deletions
+7 -3
View File
@@ -2,10 +2,10 @@
* Generated by APIlite
* https://gitea.tpsoft.org/TPsoft.org/APIlite
*
* 2025-10-01 00:23:37 */
* 2025-10-16 01:38:51 */
class backend {
endpont = import.meta.env.VITE_BACKENDAPI_URL;
endpoint = import.meta.env.VITE_BACKENDAPI_URL;
/* ----------------------------------------------------
* General API call
@@ -28,7 +28,7 @@ class backend {
if (typeof val == 'object') val = JSON.stringify(val);
form_data.append(key, val);
});
xhttp.open('POST', this.endpont + '?action=' + method);
xhttp.open('POST', this.endpoint + '?action=' + method);
xhttp.send(form_data);
}
@@ -107,6 +107,10 @@ class backend {
return this.callPromise('attachmentDelete', {attachment_id: attachment_id});
}
attachmentDownload(filename) {
return this.callPromise('attachmentDownload', {filename: filename});
}
};