Skip to content

Commit df039f9

Browse files
committed
DOC-3161: Update tinycomments_fetch_author_info documentation to indicate optional fields for authorName and authorAvatar.
1 parent 2dac5f4 commit df039f9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/ROOT/partials/configuration/tinycomments_fetch_author_info.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ The `+tinycomments_fetch_author_info+` function is passed a request (`+req+`) ob
1010
The function must call `+done+` with an object containing the following properties:
1111

1212
* `+author+` (`+string+`): A unique identifier for the user.
13-
* `+authorName+` (`+string+`): The full name to display for the user.
14-
* `+authorAvatar+` (`+string+`): A URL pointing to the user's avatar image.
13+
* `+authorName+` (`+string+`): The full name to display for the user. (`optional`)
14+
* `+authorAvatar+` (`+string+`): A URL pointing to the user's avatar image. (`optional`)
1515

1616
.Example of `+tinycomments_fetch_author_info+` function
1717
[source,js]
1818
----
1919
const tinycomments_fetch_author_info = (_, done) => {
2020
setTimeout(() => done({
2121
author: currentUser.id, // Maps to the `author` field in the comment object
22-
authorName: currentUser.fullName, // Maps to the `authorName` field in the comment object
23-
authorAvatar: currentUser.image, // Maps to the `authorAvatar` field in the comment object
22+
authorName: currentUser.fullName, // Maps to the `authorName` field in the comment object. (optional)
23+
authorAvatar: currentUser.image, // Maps to the `authorAvatar` field in the comment object. (optional)
2424
}), fakeDelay);
2525
};
2626
----
@@ -42,8 +42,8 @@ const tinycomments_fetch_author_info = (_, done) => {
4242
.then(currentUser => {
4343
done({
4444
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
45+
authorName: currentUser.fullName, // Maps to the `authorName` field in the comment object. (optional)
46+
authorAvatar: currentUser.image, // Maps to the `authorAvatar` field in the comment objectv. (optional)
4747
});
4848
});
4949
};

0 commit comments

Comments
 (0)