mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	unifying API paths to lower-case
This commit is contained in:
		| @@ -30,7 +30,7 @@ const editTreePrefix = (function() { | |||||||
|     formEl.submit(() => { |     formEl.submit(() => { | ||||||
|         const prefix = treePrefixInputEl.val(); |         const prefix = treePrefixInputEl.val(); | ||||||
|  |  | ||||||
|         server.put('tree/' + noteTreeId + '/setPrefix', { |         server.put('tree/' + noteTreeId + '/set-prefix', { | ||||||
|             prefix: prefix |             prefix: prefix | ||||||
|         }).then(() => noteTree.setPrefix(noteTreeId, prefix)); |         }).then(() => noteTree.setPrefix(noteTreeId, prefix)); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -141,7 +141,7 @@ const protected_session = (function() { | |||||||
|     async function protectSubTree(noteId, protect) { |     async function protectSubTree(noteId, protect) { | ||||||
|         await ensureProtectedSession(true, true); |         await ensureProtectedSession(true, true); | ||||||
|  |  | ||||||
|         await server.put('tree/' + noteId + "/protectSubTree/" + (protect ? 1 : 0)); |         await server.put('tree/' + noteId + "/protect-sub-tree/" + (protect ? 1 : 0)); | ||||||
|  |  | ||||||
|         showMessage("Request to un/protect sub tree has finished successfully"); |         showMessage("Request to un/protect sub tree has finished successfully"); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|  |  | ||||||
| const treeChanges = (function() { | const treeChanges = (function() { | ||||||
|     async function moveBeforeNode(node, beforeNode, changeInPath = true) { |     async function moveBeforeNode(node, beforeNode, changeInPath = true) { | ||||||
|         await server.put('notes/' + node.data.note_tree_id + '/moveBefore/' + beforeNode.data.note_tree_id); |         await server.put('notes/' + node.data.note_tree_id + '/move-before/' + beforeNode.data.note_tree_id); | ||||||
|  |  | ||||||
|         node.moveTo(beforeNode, 'before'); |         node.moveTo(beforeNode, 'before'); | ||||||
|  |  | ||||||
| @@ -14,7 +14,7 @@ const treeChanges = (function() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     async function moveAfterNode(node, afterNode, changeInPath = true) { |     async function moveAfterNode(node, afterNode, changeInPath = true) { | ||||||
|         await server.put('notes/' + node.data.note_tree_id + '/moveAfter/' + afterNode.data.note_tree_id); |         await server.put('notes/' + node.data.note_tree_id + '/move-after/' + afterNode.data.note_tree_id); | ||||||
|  |  | ||||||
|         node.moveTo(afterNode, 'after'); |         node.moveTo(afterNode, 'after'); | ||||||
|  |  | ||||||
| @@ -27,7 +27,7 @@ const treeChanges = (function() { | |||||||
|  |  | ||||||
|     // beware that first arg is noteId and second is noteTreeId! |     // beware that first arg is noteId and second is noteTreeId! | ||||||
|     async function cloneNoteAfter(noteId, afterNoteTreeId) { |     async function cloneNoteAfter(noteId, afterNoteTreeId) { | ||||||
|         const resp = await server.put('notes/' + noteId + '/cloneAfter/' + afterNoteTreeId); |         const resp = await server.put('notes/' + noteId + '/clone-after/' + afterNoteTreeId); | ||||||
|  |  | ||||||
|         if (!resp.success) { |         if (!resp.success) { | ||||||
|             alert(resp.message); |             alert(resp.message); | ||||||
| @@ -38,7 +38,7 @@ const treeChanges = (function() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     async function moveToNode(node, toNode) { |     async function moveToNode(node, toNode) { | ||||||
|         await server.put('notes/' + node.data.note_tree_id + '/moveTo/' + toNode.data.note_id); |         await server.put('notes/' + node.data.note_tree_id + '/move-to/' + toNode.data.note_id); | ||||||
|  |  | ||||||
|         node.moveTo(toNode); |         node.moveTo(toNode); | ||||||
|  |  | ||||||
| @@ -53,7 +53,7 @@ const treeChanges = (function() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     async function cloneNoteTo(childNoteId, parentNoteId) { |     async function cloneNoteTo(childNoteId, parentNoteId) { | ||||||
|         const resp = await server.put('notes/' + childNoteId + '/cloneTo/' + parentNoteId); |         const resp = await server.put('notes/' + childNoteId + '/clone-to/' + parentNoteId); | ||||||
|  |  | ||||||
|         if (!resp.success) { |         if (!resp.success) { | ||||||
|             alert(resp.message); |             alert(resp.message); | ||||||
| @@ -95,7 +95,7 @@ const treeChanges = (function() { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         await server.put('notes/' + node.data.note_tree_id + '/moveAfter/' + node.getParent().data.note_tree_id); |         await server.put('notes/' + node.data.note_tree_id + '/move-after/' + node.getParent().data.note_tree_id); | ||||||
|  |  | ||||||
|         if (node.getParent() !== null && node.getParent().getChildren().length <= 1) { |         if (node.getParent() !== null && node.getParent().getChildren().length <= 1) { | ||||||
|             node.getParent().folder = false; |             node.getParent().folder = false; | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ const utils = require('../../services/utils'); | |||||||
| const auth = require('../../services/auth'); | const auth = require('../../services/auth'); | ||||||
| const sync_table = require('../../services/sync_table'); | const sync_table = require('../../services/sync_table'); | ||||||
|  |  | ||||||
| router.put('/:noteTreeId/moveTo/:parentNoteId', auth.checkApiAuth, async (req, res, next) => { | router.put('/:noteTreeId/move-to/:parentNoteId', auth.checkApiAuth, async (req, res, next) => { | ||||||
|     const noteTreeId = req.params.noteTreeId; |     const noteTreeId = req.params.noteTreeId; | ||||||
|     const parentNoteId = req.params.parentNoteId; |     const parentNoteId = req.params.parentNoteId; | ||||||
|  |  | ||||||
| @@ -26,7 +26,7 @@ router.put('/:noteTreeId/moveTo/:parentNoteId', auth.checkApiAuth, async (req, r | |||||||
|     res.send({}); |     res.send({}); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.put('/:noteTreeId/moveBefore/:beforeNoteTreeId', async (req, res, next) => { | router.put('/:noteTreeId/move-before/:beforeNoteTreeId', async (req, res, next) => { | ||||||
|     const noteTreeId = req.params.noteTreeId; |     const noteTreeId = req.params.noteTreeId; | ||||||
|     const beforeNoteTreeId = req.params.beforeNoteTreeId; |     const beforeNoteTreeId = req.params.beforeNoteTreeId; | ||||||
|  |  | ||||||
| @@ -55,7 +55,7 @@ router.put('/:noteTreeId/moveBefore/:beforeNoteTreeId', async (req, res, next) = | |||||||
|     } |     } | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.put('/:noteTreeId/moveAfter/:afterNoteTreeId', async (req, res, next) => { | router.put('/:noteTreeId/move-after/:afterNoteTreeId', async (req, res, next) => { | ||||||
|     const noteTreeId = req.params.noteTreeId; |     const noteTreeId = req.params.noteTreeId; | ||||||
|     const afterNoteTreeId = req.params.afterNoteTreeId; |     const afterNoteTreeId = req.params.afterNoteTreeId; | ||||||
|  |  | ||||||
| @@ -82,7 +82,7 @@ router.put('/:noteTreeId/moveAfter/:afterNoteTreeId', async (req, res, next) => | |||||||
|     } |     } | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.put('/:childNoteId/cloneTo/:parentNoteId', auth.checkApiAuth, async (req, res, next) => { | router.put('/:childNoteId/clone-to/:parentNoteId', auth.checkApiAuth, async (req, res, next) => { | ||||||
|     const parentNoteId = req.params.parentNoteId; |     const parentNoteId = req.params.parentNoteId; | ||||||
|     const childNoteId = req.params.childNoteId; |     const childNoteId = req.params.childNoteId; | ||||||
|  |  | ||||||
| @@ -126,7 +126,7 @@ router.put('/:childNoteId/cloneTo/:parentNoteId', auth.checkApiAuth, async (req, | |||||||
|     }); |     }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.put('/:noteId/cloneAfter/:afterNoteTreeId', async (req, res, next) => { | router.put('/:noteId/clone-after/:afterNoteTreeId', async (req, res, next) => { | ||||||
|     const noteId = req.params.noteId; |     const noteId = req.params.noteId; | ||||||
|     const afterNoteTreeId = req.params.afterNoteTreeId; |     const afterNoteTreeId = req.params.afterNoteTreeId; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ router.get('/', auth.checkApiAuth, async (req, res, next) => { | |||||||
|     }); |     }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.put('/:noteId/protectSubTree/:isProtected', auth.checkApiAuth, async (req, res, next) => { | router.put('/:noteId/protect-sub-tree/:isProtected', auth.checkApiAuth, async (req, res, next) => { | ||||||
|     const noteId = req.params.noteId; |     const noteId = req.params.noteId; | ||||||
|     const isProtected = !!parseInt(req.params.isProtected); |     const isProtected = !!parseInt(req.params.isProtected); | ||||||
|     const dataKey = protected_session.getDataKey(req); |     const dataKey = protected_session.getDataKey(req); | ||||||
| @@ -47,7 +47,7 @@ router.put('/:noteId/protectSubTree/:isProtected', auth.checkApiAuth, async (req | |||||||
|     res.send({}); |     res.send({}); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.put('/:noteTreeId/setPrefix', auth.checkApiAuth, async (req, res, next) => { | router.put('/:noteTreeId/set-prefix', auth.checkApiAuth, async (req, res, next) => { | ||||||
|     const noteTreeId = req.params.noteTreeId; |     const noteTreeId = req.params.noteTreeId; | ||||||
|     const prefix = utils.isEmptyOrWhitespace(req.body.prefix) ? null : req.body.prefix; |     const prefix = utils.isEmptyOrWhitespace(req.body.prefix) ? null : req.body.prefix; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user