diff --git a/src/public/javascripts/desktop.js b/src/public/javascripts/desktop.js index f9142eb02..50697abb9 100644 --- a/src/public/javascripts/desktop.js +++ b/src/public/javascripts/desktop.js @@ -81,7 +81,7 @@ window.onerror = function (msg, url, lineNo, columnNo, error) { }; for (const appCssNoteId of window.appCssNoteIds) { - cssLoader.requireCss(`/api/notes/${appCssNoteId}/download`); + cssLoader.requireCss(`/api/notes/download/${appCssNoteId}`); } const wikiBaseUrl = "https://github.com/zadam/trilium/wiki/"; diff --git a/src/public/javascripts/dialogs/options.js b/src/public/javascripts/dialogs/options.js index c84bb3074..5d5f4fbc1 100644 --- a/src/public/javascripts/dialogs/options.js +++ b/src/public/javascripts/dialogs/options.js @@ -98,7 +98,7 @@ addTabHandler((function() { if (noteId) { // make sure the CSS is loaded // if the CSS has been loaded and then updated then the changes won't take effect though - cssLoader.requireCss(`/api/notes/${noteId}/download`); + cssLoader.requireCss(`/api/notes/download/${noteId}`); } $body.addClass("theme-" + newTheme); diff --git a/src/routes/routes.js b/src/routes/routes.js index 22c96f7a1..4c499e73a 100644 --- a/src/routes/routes.js +++ b/src/routes/routes.js @@ -135,6 +135,8 @@ function register(app) { filesRoute.uploadFile, apiResultHandler); route(GET, '/api/notes/:noteId/download', [auth.checkApiAuthOrElectron], filesRoute.downloadFile); + // this "hacky" path is used for easier referencing of CSS resources + route(GET, '/api/notes/download/:noteId', [auth.checkApiAuthOrElectron], filesRoute.downloadFile); apiRoute(GET, '/api/notes/:noteId/attributes', attributesRoute.getEffectiveNoteAttributes); apiRoute(PUT, '/api/notes/:noteId/attributes', attributesRoute.updateNoteAttributes);