Home Reference Source
import CommentsRequest from '~/models/Request/Comments.js'
public class | source

CommentsRequest

Extends:

js/models/models/Request/Request.js~Request → CommentsRequest

Obtains paginated comments

Constructor Summary

Public Constructor
public

constructor(type: string, id: number | string, page: number, parentId: number, intialOffset: number)

Creates a new comment

Method Summary

Public Methods
public

format(data: Object): Object

Returns the new comment object

Public Constructors

public constructor(type: string, id: number | string, page: number, parentId: number, intialOffset: number) source

Creates a new comment

Params:

NameTypeAttributeDescription
type string

post or answer

id number | string

Id of post or answer

page number

Comment page number (0-indexed)

parentId number
  • nullable: true

The parent ID if loading a subcomment. -1 if none

intialOffset number
  • optional
  • default: COMMENT_COUNT
  • nullable: true

How many are loaded before paging started counting

Public Methods

public format(data: Object): Object source

Returns the new comment object

Params:

NameTypeAttributeDescription
data Object

Return:

Object

in format comments: Comment[], areMore: bool