Skip to content

Commit 1e09b0a

Browse files
committed
DOC-3251: Update to use new API
1 parent 9d74e12 commit 1e09b0a

File tree

8 files changed

+16
-64
lines changed

8 files changed

+16
-64
lines changed

modules/ROOT/examples/live-demos/comments-callback-with-mentions/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const user_id = 'james-wilson';
44
const collaborator_id = 'mia-andersson';
@@ -263,12 +263,6 @@ tinymce.init({
263263
fetch_users: (userIds) => Promise.all(userIds
264264
.map((userId) =>
265265
fetch(`${API_URL}/${userId}`)
266-
.then((response) => response.json())
267-
.then((user) => ({
268-
id: user.id,
269-
name: user.name,
270-
avatar: user.image,
271-
custom: user
272-
}))
273-
.catch(() => ({ id: userId }))))
266+
.then((response) => response.json())
267+
.catch(() => ({ id: userId }))))
274268
});

modules/ROOT/examples/live-demos/comments-callback/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const user_id = 'james-wilson';
44
const collaborator_id = 'mia-andersson';
@@ -211,12 +211,6 @@ tinymce.init({
211211
fetch_users: (userIds) => Promise.all(userIds
212212
.map((userId) =>
213213
fetch(`${API_URL}/${userId}`)
214-
.then((response) => response.json())
215-
.then((user) => ({
216-
id: user.id,
217-
name: user.name,
218-
avatar: user.image,
219-
custom: user
220-
}))
221-
.catch(() => ({ id: userId }))))
214+
.then((response) => response.json())
215+
.catch(() => ({ id: userId }))))
222216
});

modules/ROOT/examples/live-demos/comments-embedded-with-mentions/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const mentions_fetch = async (query, success) => {
44
const searchPhrase = query.term.toLowerCase();
@@ -82,12 +82,6 @@ tinymce.init({
8282
fetch_users: (userIds) => Promise.all(userIds
8383
.map((userId) =>
8484
fetch(`${API_URL}/${userId}`)
85-
.then((response) => response.json())
86-
.then((user) => ({
87-
id: user.id,
88-
name: user.name,
89-
avatar: user.image,
90-
custom: user
91-
}))
92-
.catch(() => ({ id: userId }))))
85+
.then((response) => response.json())
86+
.catch(() => ({ id: userId }))))
9387
});

modules/ROOT/examples/live-demos/comments-embedded/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const user_id = 'james-wilson';
44

@@ -29,12 +29,6 @@ tinymce.init({
2929
fetch_users: (userIds) => Promise.all(userIds
3030
.map((userId) =>
3131
fetch(`${API_URL}/${userId}`)
32-
.then((response) => response.json())
33-
.then((user) => ({
34-
id: user.id,
35-
name: user.name,
36-
avatar: user.image,
37-
custom: user
38-
}))
39-
.catch(() => ({ id: userId }))))
32+
.then((response) => response.json())
33+
.catch(() => ({ id: userId }))))
4034
});

modules/ROOT/examples/live-demos/revisionhistory/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const fakeDelay = 200;
44

@@ -170,11 +170,5 @@ tinymce.init({
170170
.map((userId) =>
171171
fetch(`${API_URL}/${userId}`)
172172
.then((response) => response.json())
173-
.then((user) => ({
174-
id: user.id,
175-
name: user.name,
176-
avatar: user.image,
177-
custom: user
178-
}))
179173
.catch(() => ({ id: userId })))),
180174
});

modules/ROOT/examples/live-demos/suggestededits-access-feedback/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const tinymceElement = document.querySelector('textarea#suggestededits-access-feedback');
44
const model = JSON.parse(tinymceElement.getAttribute('suggestededits-model'));
@@ -19,11 +19,5 @@ tinymce.init({
1919
.map((userId) =>
2020
fetch(`${API_URL}/${userId}`)
2121
.then((response) => response.json())
22-
.then((user) => ({
23-
id: user.id,
24-
name: user.name,
25-
avatar: user.image,
26-
custom: user
27-
}))
2822
.catch(() => ({ id: userId })))),
2923
});

modules/ROOT/examples/live-demos/suggestededits-access-read/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const tinymceElement = document.querySelector('textarea#suggestededits-access-feedback');
44
const model = JSON.parse(tinymceElement.getAttribute('suggestededits-model'));
@@ -19,11 +19,5 @@ tinymce.init({
1919
.map((userId) =>
2020
fetch(`${API_URL}/${userId}`)
2121
.then((response) => response.json())
22-
.then((user) => ({
23-
id: user.id,
24-
name: user.name,
25-
avatar: user.image,
26-
custom: user
27-
}))
2822
.catch(() => ({ id: userId })))),
2923
});

modules/ROOT/examples/live-demos/suggestededits/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const API_URL = 'https://demouserdirectory.tiny.cloud/users';
1+
const API_URL = 'https://demouserdirectory.tiny.cloud/v1/users';
22

33
const tinymceElement = document.querySelector('textarea#suggestededits');
44
const model = JSON.parse(tinymceElement.getAttribute('suggestededits-model'));
@@ -19,11 +19,5 @@ tinymce.init({
1919
.map((userId) =>
2020
fetch(`${API_URL}/${userId}`)
2121
.then((response) => response.json())
22-
.then((user) => ({
23-
id: user.id,
24-
name: user.name,
25-
avatar: user.image,
26-
custom: user
27-
}))
2822
.catch(() => ({ id: userId })))),
2923
});

0 commit comments

Comments
 (0)