-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathtiptap-editor.js
More file actions
27 lines (24 loc) · 1.51 KB
/
tiptap-editor.js
File metadata and controls
27 lines (24 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
suggestion: {
items: async (query) => {
const queryString = (query?.query || query || '').toString().toLowerCase();
const siteRoot = dnn.getVar('sf_siteRoot', '/');
const url = `${siteRoot}API/ActiveForums/User/GetUsersForEditorMentions?forumId=${forumId}&query=${encodeURIComponent(queryString)}`;
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'RequestVerificationToken': $('[name="__RequestVerificationToken"]').val(),
'ModuleId': moduleId,
'TabId': tabId,
},
});
if (!response.ok) {
console.error(`API error: ${response.status}`);
return [];
}
return await response.json();
} catch (error) {
console.error('Failed to fetch users for mentions:', error);
return [];
}
},