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

FollowUser

Extends:

Request → FollowUser

Follows or unfollows a user. This updates the state

Constructor Summary

Public Constructor
public

constructor(user: User, opts: Object)

Requires authorization

Member Summary

Public Members
public

The user target of the request

Method Summary

Public Methods
public

format()

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(user: User, opts: Object) source

Requires authorization

Override:

Request#constructor

Params:

NameTypeAttributeDescription
user User

The user to follow.

opts Object
opts.shouldFollow boolean
  • optional
  • default: true

what the resulting follow status should be

Public Members

public user: User source

The user target of the request

Public Methods

public format() source

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

Override:

Request#format