Skip to main content

Comments Management

Getting Started

In this section, we will show you how to manage your activity feeds comments.

Prerequisites

  1. Busy Hour Account (Sign Up if you don't have one yet)
  2. Create a Busy Hour Project from the Dashboard/Projects
  3. Create a Busy Hour App from from the Dashboard/Apps
  4. Download Busy Hour App config file from from the Dashboard/Apps

Comments Management

To start commenting your activity feed, updating your comments, and deleting your comments, you can use the useComment hooks from @busy-hour/react package. The hook itself will return the following objects:

PropertyTypeDescription
createFunctionThe function to create comment
updateFunctionThe function to update comment
listFunctionThe function to list comment
findFunctionThe function to find comment
deleteFunctionThe function to delete comment

Creating Comment

To create your comment, you can use the create function. The function itself take the following properties:

PropertyTypeDescription
versionnumberThe The version of your comment
feedIdstringThe id of your feed you want to comment on
attributesobjectThe attributes of your comment

Updating Comment

To update your comment, you can use the update function. The function itself take the following properties:

PropertyTypeDescription
versionnumberThe The version of your comment
commentIdstringThe id of your comment you want to update
feedIdstringThe id of your feed you want to comment on
attributesobjectThe attributes of your comment

Listing Comments

To list your comments, you can use the list function. The function itself take the following properties:

PropertyTypeDescription
versionnumberThe The version of your comments
limitnumber (optional)Total number of comments to retrieve, (default: 10)
pagenumber (optional)The page number of comments to retrieve, (default: 1)
userIdstring (optional)The user id of the comments you want to list
feedIdstring (optional)The feed id comments you want to list

Finding Comment

To find your comment, you can use the find function. The function itself take the following properties:

PropertyTypeDescription
versionnumberThe The version of your comment
commentIdstringThe id of your comment you want to find

Deleting Comment

To delete your comment, you can use the delete function. The function itself take the following properties:

PropertyTypeDescription
versionnumberThe The version of your comment
commentIdstringThe id of your comment you want to delete

Quick Example

src/main.tsx
import React from 'react';
import { useComment } from '@busy-hour/react';

export default function Main() {
const manager = useComment();

// ...rest of your code
}