Infohub JS API
Loading...
Searching...
No Matches
BcfCommentResource Class Reference

Description

Represents one comment-scoped BCF API resource.

const comment = topic.comment(commentId);
await comment.update({ comment: "Edited" });
await comment.delete();

Public Member Functions

 delete ()
get events ()
 get ()
 update (commentData)

Function Documentation

◆ delete()

delete ( )
Returns
{Promise<ApiResponse>} Status only, no payload.
// No request body. Output: HTTP 200, no payload.

◆ events()

get events ( )

Gets this comment's event collection.

Returns
{BcfListResource} A listable resource.
// Output of events.list():
[{
"comment_guid": "C4215F4D-AC45-A43A-D615-AA456BEF832B",
"topic_guid": "A211FCC2-3A3B-EAA4-C321-DE22ABC8414",
"date": "2014-11-19T14:24:11.316Z",
"author": "Architect@example.com",
"events": [{ "type": "comment_created", "value": null }]
}]

◆ get()

get ( )
Returns
{Promise<ApiResponse>} The response containing the comment.
// Output:
{
"guid": "A333FCA8-1A31-CAAC-A321-BB33ABC8414",
"date": "2016-08-01T14:24:11.316Z",
"author": "bob.heater@example.com",
"comment": "will rework the heating model",
"topic_guid": "B345F4F2-3A04-B43B-A713-5E456BEF8228"
}

◆ update()

update ( commentData)

Narrower than BcfCommentsResource#create: reply_to_comment_guid cannot be changed here, only set at creation.

Parameters
{object}commentData - Comment fields to update (comment, viewpoint_guid).
Returns
{Promise<ApiResponse>} The response containing the updated comment.
// Input:
{ "comment": "will rework the heating model and fix the ventilation" }
// Output:
{
"guid": "A333FCA8-1A31-CAAC-A321-BB33ABC8414",
"date": "2016-08-01T14:24:11.316Z",
"author": "bob.heater@example.com",
"comment": "will rework the heating model and fix the ventilation",
"topic_guid": "B345F4F2-3A04-B43B-A713-5E456BEF8228"
}