Skip to content

Commit 87234e3

Browse files
committed
DOC-2578: Update callback demo to include commentAuthor.
1 parent 7dd1d3b commit 87234e3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ const tinycomments_reply = (req, done, fail) => {
4848
})
4949
.then((req2) => {
5050
const commentUid = req2.commentUid;
51-
done({ commentUid });
51+
done({
52+
commentUid: replyUid,
53+
author: currentUser.id,
54+
authorName: currentUser.fullName
55+
});
5256
})
5357
.catch((e) => {
5458
fail(e);

modules/ROOT/partials/configuration/tinycomments_reply.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ The `+done+` callback should accept the following object:
1616
[source,js]
1717
----
1818
{
19-
commentUid: string // the value of the new comment uid
19+
commentUid: string, // the value of the new comment uid
20+
author: string, // the id of the current author
21+
authorName: string // the name of the current authorName
2022
}
2123
----
2224

@@ -42,7 +44,11 @@ const reply_comment = (ref, done, fail) => {
4244
})
4345
.then((ref2) => {
4446
let commentUid = ref2.commentUid;
45-
done({ commentUid: commentUid });
47+
done({
48+
commentUid: replyUid,
49+
author: currentUser.id,
50+
authorName: currentUser.fullName
51+
});
4652
})
4753
.catch((e) => {
4854
fail(e);

0 commit comments

Comments
 (0)