various fixes and improvements

This commit is contained in:
vabene1111
2025-04-04 22:00:10 +02:00
parent 934d78c50e
commit 7314572fc0
616 changed files with 78158 additions and 99608 deletions

View File

@@ -8,11 +8,15 @@ export function useDjangoUrls() {
/**
* given a path return the full server url to that url respecting possible sub path setups
* @param path
* @param appendSlash automatically append a slash to the end of the url (default true)
*/
function getDjangoUrl(path: string){
if(path.charAt(0) == '/'){
function getDjangoUrl(path: string, appendSlash = true){
if(path.startsWith('/')){
path = path.substring(1)
}
if(!path.endsWith('/') && appendSlash){
path = path + '/'
}
return `${basePath}/${path}`
}