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

WriteCommentRequest

Extends:

Request → WriteCommentRequest

Submits a comment

Constructor Summary

Public Constructor
public

constructor(type: string, id: number | string, value: string, parentComment: number)

Creates a new comment

Method Summary

Public Methods
public

Returns the new comment object

Inherited Summary

From class Request
protected
public

cancel()

Cancels the request.

public

format(data: Object): Object

Formats the request object and returns an object of Request<T>'s T.

public

async run(o: Object): Promise

Performs the request

Public Constructors

public constructor(type: string, id: number | string, value: string, parentComment: number) source

Creates a new comment

Override:

Request#constructor

Params:

NameTypeAttributeDescription
type string

post or answer

id number | string

Id of post or answer

value string

Actual content of comment

parentComment number
  • nullable: true

The id of the parent comment

Public Methods

public format(data: Object): Comment source

Returns the new comment object

Override:

Request#format

Params:

NameTypeAttributeDescription
data Object

Return:

Comment