From a85909291ec355dd0cad8b0e2fd0518b1559ff91 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Tue, 19 Nov 2024 11:11:04 +1000 Subject: [PATCH] DOC-2579: Update the example using mentions_fetch to reflect demo changes. --- .../ROOT/partials/configuration/mentions_fetch.adoc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/ROOT/partials/configuration/mentions_fetch.adoc b/modules/ROOT/partials/configuration/mentions_fetch.adoc index 40c59bf62c..923068fa58 100644 --- a/modules/ROOT/partials/configuration/mentions_fetch.adoc +++ b/modules/ROOT/partials/configuration/mentions_fetch.adoc @@ -26,15 +26,13 @@ tinymce.init({ usersRequest = fetch('/users'); } usersRequest.then((users) => { - // query.term is the text the user typed after the '@' - users = users.filter((user) => { - return user.name.indexOf(query.term.toLowerCase()) !== -1; - }); + /* `query.term` is the text the user typed after the '@' */ + users = users.filter((user) => user.name.toLowerCase().includes(query.term.toLowerCase())) users = users.slice(0, 10); - // Where the user object must contain the properties `id` and `name` - // but you could additionally include anything else you deem useful. + /* Where the user object must contain the properties `id` and `name` + but you could additionally include anything else you deem useful. */ success(users); }); }