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

Post

Extends:

Request → Post

Describes a post.

Constructor Summary

Public Constructor
public

constructor(title: string, body: string, ppcgId: number)

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(title: string, body: string, ppcgId: number) source

Creates a 'create post' request. Requires authorization

Override:

Request#constructor

Params:

NameTypeAttributeDescription
title string
body string

Markdown body

ppcgId number
  • nullable: true

if applicable. The ID of the respective PPCG post

Public Methods

public format(): string source

Returns redirect URL

Override:

Request#format

Return:

string

redirect url