Files
lucent-laravel/front/js/svelte/files/imageserver.js
T
2023-10-20 21:17:43 +03:00

16 lines
395 B
JavaScript

import {getContext} from "svelte";
export function imgurl(record) {
if(record._file.mime === "image/svg+xml"){
return fileurl(record);
}
const channel = getContext("channel")
return channel.filesUrl + `/thumbs/${record._file.path}`;
}
export function fileurl(record) {
const channel = getContext("channel")
return channel.filesUrl + `/${record._file.path}`;
}