fix weird bug with ts import

This commit is contained in:
2022-06-27 14:51:48 +02:00
parent 3ea630748a
commit a9bc98738e
11 changed files with 34 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
import {Scope} from 'ChillMainAssets/types';
import {Scope} from '../../types';
export type body = {[key: string]: boolean|string|number|null};
export type fetchOption = {[key: string]: boolean|string|number|null};

View File

@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2018 Champs Libres Cooperative <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -15,12 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var mime = require('mime-types')
var mime = require('mime')
var download_report = (url, container) => {
var download_text = container.dataset.downloadText,
alias = container.dataset.alias;
window.fetch(url, { credentials: 'same-origin' })
.then(response => {
if (!response.ok) {
@@ -29,21 +29,21 @@ var download_report = (url, container) => {
return response.blob();
}).then(blob => {
var content = URL.createObjectURL(blob),
link = document.createElement("a"),
type = blob.type,
hasForcedType = 'mimeType' in container.dataset,
extension;
if (hasForcedType) {
// force a type
type = container.dataset.mimeType;
blob = new Blob([ blob ], { 'type': type });
content = URL.createObjectURL(blob);
}
extension = mime.extension(type);
extension = mime.getExtension(type);
link.appendChild(document.createTextNode(download_text));
link.classList.add("btn", "btn-action");
@@ -56,7 +56,7 @@ var download_report = (url, container) => {
container.appendChild(link);
}).catch(function(error) {
console.log(error);
var problem_text =
var problem_text =
document.createTextNode("Problem during download");
container
@@ -64,4 +64,4 @@ var download_report = (url, container) => {
});
};
module.exports = download_report;
module.exports = download_report;

View File

@@ -1,5 +1,5 @@
import { createI18n } from 'vue-i18n';
import datetimeFormats from 'ChillMainAssets/vuejs/i18n/datetimeFormats';
import datetimeFormats from '../i18n/datetimeFormats';
const messages = {
fr: {