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

Post

Extends:

Request → Post

Sends an new answer.

Constructor Summary

Public Constructor
public

constructor(code: string, commentary: string, post: Post, encoding: Encoding, language: Language)

Creates a 'create post' request.

Method Summary

Public Methods
public

Returns redirect URL

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(code: string, commentary: string, post: Post, encoding: Encoding, language: Language) source

Creates a 'create post' request. Requires authorization

Override:

Request#constructor

Params:

NameTypeAttributeDescription
code string

Code as a valid JS string

commentary string

markdown commentary to submit

post Post

The post we are replying to

encoding Encoding

The encoding to use.

language Language

The language to use

Public Methods

public format(): string source

Returns redirect URL

Override:

Request#format

Return:

string

redirect url