chore(share): fix @typescript-eslint/no-unused-vars for "next"

alternative solution, since they are unused and it is the last argument → remove it.
We can still go that route later on though, if we agree upon it.
This commit is contained in:
Panagiotis Papadopoulos 2025-03-10 07:33:20 +01:00
parent bdc829198c
commit c2b75a6421

View File

@ -195,7 +195,7 @@ function register(router: Router) {
} }
} }
router.get("/share/", (req, res, next) => { router.get("/share/", (req, res, _next) => {
if (req.path.substr(-1) !== "/") { if (req.path.substr(-1) !== "/") {
res.redirect("../share/"); res.redirect("../share/");
return; return;
@ -211,7 +211,7 @@ function register(router: Router) {
renderNote(shaca.shareRootNote, req, res); renderNote(shaca.shareRootNote, req, res);
}); });
router.get("/share/:shareId", (req, res, next) => { router.get("/share/:shareId", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
const { shareId } = req.params; const { shareId } = req.params;
@ -221,7 +221,7 @@ function register(router: Router) {
renderNote(note, req, res); renderNote(note, req, res);
}); });
router.get("/share/api/notes/:noteId", (req, res, next) => { router.get("/share/api/notes/:noteId", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
let note: SNote | boolean; let note: SNote | boolean;
@ -234,7 +234,7 @@ function register(router: Router) {
res.json(note.getPojo()); res.json(note.getPojo());
}); });
router.get("/share/api/notes/:noteId/download", (req, res, next) => { router.get("/share/api/notes/:noteId/download", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
let note: SNote | boolean; let note: SNote | boolean;
@ -256,7 +256,7 @@ function register(router: Router) {
}); });
// :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename // :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename
router.get("/share/api/images/:noteId/:filename", (req, res, next) => { router.get("/share/api/images/:noteId/:filename", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
let image: SNote | boolean; let image: SNote | boolean;
@ -282,7 +282,7 @@ function register(router: Router) {
}); });
// :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename // :filename is not used by trilium, but instead used for "save as" to assign a human-readable filename
router.get("/share/api/attachments/:attachmentId/image/:filename", (req, res, next) => { router.get("/share/api/attachments/:attachmentId/image/:filename", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
let attachment: SAttachment | boolean; let attachment: SAttachment | boolean;
@ -300,7 +300,7 @@ function register(router: Router) {
} }
}); });
router.get("/share/api/attachments/:attachmentId/download", (req, res, next) => { router.get("/share/api/attachments/:attachmentId/download", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
let attachment: SAttachment | boolean; let attachment: SAttachment | boolean;
@ -322,7 +322,7 @@ function register(router: Router) {
}); });
// used for PDF viewing // used for PDF viewing
router.get("/share/api/notes/:noteId/view", (req, res, next) => { router.get("/share/api/notes/:noteId/view", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
let note: SNote | boolean; let note: SNote | boolean;
@ -340,7 +340,7 @@ function register(router: Router) {
}); });
// Used for searching, require noteId so we know the subTreeRoot // Used for searching, require noteId so we know the subTreeRoot
router.get("/share/api/notes", (req, res, next) => { router.get("/share/api/notes", (req, res, _next) => {
shacaLoader.ensureLoad(); shacaLoader.ensureLoad();
const ancestorNoteId = req.query.ancestorNoteId ?? "_share"; const ancestorNoteId = req.query.ancestorNoteId ?? "_share";