Skip to content

Commit 6b6ac21

Browse files
authored
Update modules/ROOT/partials/configuration/tinycomments_fetch_author_info.adoc
1 parent 792360f commit 6b6ac21

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

modules/ROOT/partials/configuration/tinycomments_fetch_author_info.adoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ const currentUser = {
3737
};
3838
3939
const tinycomments_fetch_author_info = (_, done) => {
40-
setTimeout(() => done({
41-
author: currentUser.id, // Maps to the `author` field in the comment object
42-
authorName: currentUser.fullName, // Maps to the `authorName` field in the comment object
43-
authorAvatar: currentUser.image, // Maps to the `authorAvatar` field in the comment object
44-
}), fakeDelay);
40+
fetch('https://example.api.com/currentUser')
41+
.then(res => res.json())
42+
.then(currentUser => {
43+
done({
44+
author: currentUser.id, // Maps to the `author` field in the comment object
45+
authorName: currentUser.fullName, // Maps to the `authorName` field in the comment object
46+
authorAvatar: currentUser.image, // Maps to the `authorAvatar` field in the comment object
47+
});
48+
});
4549
};
4650
4751
tinymce.init({

0 commit comments

Comments
 (0)