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

PostVote

Extends:

RequestVote → PostVote

Submits a vote request for a post

Constructor Summary

Public Constructor
public

constructor(postId: number, voteType: string, idAdding: boolean)

Sets the vote on an answer.

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

From class Vote
public

format(data: Object): Object

Returns total and voted.

Public Constructors

public constructor(postId: number, voteType: string, idAdding: boolean) source

Sets the vote on an answer.

Override:

Vote#constructor

Params:

NameTypeAttributeDescription
postId number
voteType string
idAdding boolean

If the vote is being set or removed.