Class

EntityComments

EntityComments(client, entityName, entityId)

Class corresponding to Aworks Comments Endpoints
Constructor

# new EntityComments(client, entityName, entityId)

Endpoint constructor
Parameters:
Name Type Description
client Client
entityName 'companies' | 'files' | 'projects' | 'tasks'
entityId String
See:
  • [Comments in Awork API Docs](https://openapi.awork.com/#/Comments)

View Source endpoints/EntityComments.js, line 11

Classes

EntityComments

Methods

# async create(comment) → {Promise.<Comment>}

Creates a new comment on the entity with the specified id.
Parameters:
Name Type Description
comment CommentCreateModel The model to create a comment.

View Source endpoints/EntityComments.js, line 61

Promise.<Comment>

# async delete(commentId) → {Promise.<void>}

Deletes the comment with the specified id on the entity with the specified id. The delete includes the attachments of the comment.
Parameters:
Name Type Description
commentId String The id of the comment.

View Source endpoints/EntityComments.js, line 96

Promise.<void>

# files(commentId) → {EntityFiles}

Returns the EntityFiles Endpoint with the specified comment Id and entityType 'comments'.
Parameters:
Name Type Description
commentId String The id of the comment.

View Source endpoints/EntityComments.js, line 121

EntityFiles

# async get(commentId) → {Promise.<Comment>}

Returns the comment with the specified id of the entity with the specified id.
Parameters:
Name Type Description
commentId String The id of the comment.

View Source endpoints/EntityComments.js, line 32

Promise.<Comment>

# async list(optionsopt) → {Promise.<Comment>}

Returns all comments of the entity with the specified id.
Parameters:
Name Type Attributes Description
options ListOptions <optional>
Pagination and filtering options

View Source endpoints/EntityComments.js, line 43

Promise.<Comment>

# async react(commentId, reaction) → {Promise.<void>}

Updates the reactions of the comment with the specified id on the entity with the specified id.
Parameters:
Name Type Description
commentId String The id of the comment.
reaction ReactionsUpdateModel The model to update the reactions from a comment.

View Source endpoints/EntityComments.js, line 112

Promise.<void>

# async update(commentId, comment) → {Promise.<Comment>}

Updates the comment with the specified id on the entity with the specified id.
Parameters:
Name Type Description
commentId String The id of the comment.
comment CommentUpdateModel The model to update a comment.

View Source endpoints/EntityComments.js, line 85

Promise.<Comment>