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

Vote

Extends:

Request → Vote

Direct Subclass:

PostVote

A generic voting type

Constructor Summary

Public Constructor
public

constructor(url: string, voteType: string, isAdding: boolean)

Sets the vote on an answer.

Method Summary

Public Methods
public

format(data: Object): Object

Returns total and voted.

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(url: string, voteType: string, isAdding: boolean) source

Sets the vote on an answer.

Override:

Request#constructor

Params:

NameTypeAttributeDescription
url string

url endpoint

voteType string
isAdding boolean

if is being set.

Public Methods

public format(data: Object): Object source

Returns total and voted.

Override:

Request#format

Params:

NameTypeAttributeDescription
data Object

Return:

Object