File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
modules/ROOT/partials/plugin-apis Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,22 @@ For guidance on retrieving and verifying the `mentionedUids` array, refer to the
131131
132132[source,js]
133133----
134- // Fake database of users
135- const users = {
136- "johndoe": "John Doe",
137- "janedoe": "Jane Doe",
138- "alicedoe": "Alice Doe",
134+ // Sample user database
135+ const userDb = {
136+ "johnsmith": {
137+ "id": "johnsmith",
138+ "name": "John Smith",
139+ "fullName": "John Smith",
140+ "description": "Company Founder",
141+ "image": "https://i.pravatar.cc/150?img=11"
142+ },
143+ "jennynichols": {
144+ "id": "jennynichols",
145+ "name": "Jenny Nichols",
146+ "fullName": "Jenny Nichols",
147+ "description": "Marketing Director",
148+ "image": "https://i.pravatar.cc/150?img=10"
149+ }
139150};
140151
141152const comments = tinymce.activeEditor.plugins.tinycomments;
@@ -152,7 +163,7 @@ const events = eventLog.events;
152163const validatedEvents = JSON.parse(JSON.stringify(events));
153164validatedEvents.forEach((event) => {
154165 // Filter out invalid users - change this to your own validation logic
155- event.mentionedUids = event.mentionedUids ? event.mentionedUids.filter((uid) => users [uid]) : undefined;
166+ event.mentionedUids = event.mentionedUids ? event.mentionedUids.filter((uid) => userDb [uid]) : undefined;
156167});
157168
158169const mentionedUsers = validatedEvents.flatMap(({ mentionedUids }) => mentionedUids || []);
You can’t perform that action at this time.
0 commit comments