From 7fe39d4e52435d8ea4fcf46a31223c14cf113579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Thu, 21 Dec 2023 18:02:37 +0100 Subject: [PATCH] Ts assets module fix --- resources/ts/index.d.ts | 6 +++--- resources/ts/modules/asset.ts | 2 +- resources/views/modules/script-constants.blade.php | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/ts/index.d.ts b/resources/ts/index.d.ts index 4c614ed..ba9101e 100644 --- a/resources/ts/index.d.ts +++ b/resources/ts/index.d.ts @@ -1,6 +1,6 @@ -export {}; -import { AxiosStatic } from "axios"; +export { }; import type VueTagsInput from "@sipec/vue3-tags-input"; +import { AxiosStatic } from "axios"; // * Enum interface EnumInterface { @@ -75,7 +75,7 @@ declare global { Swal: Function; vueDebug: boolean | undefined; __SYSTEM: { - _asset: string; + _asset: Record; _locale: string; _routes: Record; _translations: { diff --git a/resources/ts/modules/asset.ts b/resources/ts/modules/asset.ts index f4e7ea8..7db4d6e 100644 --- a/resources/ts/modules/asset.ts +++ b/resources/ts/modules/asset.ts @@ -1,7 +1,7 @@ export default { methods: { asset(path: string) { - return `${window.__SYSTEM._asset}${path}`; + return `${window.__SYSTEM._asset[path] ?? path}`; }, }, }; diff --git a/resources/views/modules/script-constants.blade.php b/resources/views/modules/script-constants.blade.php index ea82742..1b03156 100644 --- a/resources/views/modules/script-constants.blade.php +++ b/resources/views/modules/script-constants.blade.php @@ -1,8 +1,10 @@ -