mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
make :filename for GETing an image optional
This commit is contained in:
parent
e156c6292b
commit
f53a93e828
@ -285,7 +285,7 @@ function register(app) {
|
|||||||
apiRoute(POST, '/api/special-notes/search-note', specialNotesRoute.createSearchNote);
|
apiRoute(POST, '/api/special-notes/search-note', specialNotesRoute.createSearchNote);
|
||||||
apiRoute(POST, '/api/special-notes/save-search-note', specialNotesRoute.saveSearchNote);
|
apiRoute(POST, '/api/special-notes/save-search-note', specialNotesRoute.saveSearchNote);
|
||||||
|
|
||||||
route(GET, '/api/images/:noteId/:filename', [auth.checkApiAuthOrElectron], imageRoute.returnImage);
|
route(GET, ['/api/images/:noteId/:filename', '/api/images/:noteId'], [auth.checkApiAuthOrElectron], imageRoute.returnImage);
|
||||||
route(POST, '/api/images', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware], imageRoute.uploadImage, apiResultHandler);
|
route(POST, '/api/images', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware], imageRoute.uploadImage, apiResultHandler);
|
||||||
route(PUT, '/api/images/:noteId', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware], imageRoute.updateImage, apiResultHandler);
|
route(PUT, '/api/images/:noteId', [auth.checkApiAuthOrElectron, uploadMiddleware, csrfMiddleware], imageRoute.updateImage, apiResultHandler);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ function register(router) {
|
|||||||
res.send(note.getContent());
|
res.send(note.getContent());
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/share/api/images/:noteId/:filename', (req, res, next) => {
|
router.get(['/share/api/images/:noteId/:filename', '/share/api/images/:noteId'], (req, res, next) => {
|
||||||
const image = shaca.getNote(req.params.noteId);
|
const image = shaca.getNote(req.params.noteId);
|
||||||
|
|
||||||
if (!image) {
|
if (!image) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user