Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseResource<T>

BaseResource provides the default Resource implementation.

Warning: All data passed to this class MUST BE PROPERLY VALIDATED!! Otherwise users may be able to manipulate queries and have direct access to the database.

Type parameters

  • T: Object

Hierarchy

  • BaseResource

Implements

Index

Properties

isAborted

isAborted: boolean = false

Methods

abort

  • abort(): void
  • abort can be called in a before*() handler to signal that the operation has been cancelled and should proceed no further.

    Logic calling this method should ensure that an appropriate response is sent to the user.

    Returns void

before

  • before(r: Request): Action<Request>
  • before is a filter that is executed before each of the CSUGR methods.

    It can be overriden to execute other middleware.

    Parameters

    • r: Request

    Returns Action<Request>

beforeCreate

  • beforeCreate(r: Request): Action<Request>
  • beforeCreate is executed before create().

    Parameters

    • r: Request

    Returns Action<Request>

beforeGet

  • beforeGet(r: Request): Action<Request>
  • beforeGet is executed before get().

    Parameters

    • r: Request

    Returns Action<Request>

beforeRemove

  • beforeRemove(r: Request): Action<Request>
  • beforeRemove is executed before remove().

    Parameters

    • r: Request

    Returns Action<Request>

beforeSearch

  • beforeSearch(r: Request): Action<Request>
  • beforeSearch is executed before search().

    Parameters

    • r: Request

    Returns Action<Request>

beforeUpdate

  • beforeUpdate(r: Request): Action<Request>
  • beforeUpdate is executed before update().

    Parameters

    • r: Request

    Returns Action<Request>

create

  • create(r: Request): Action<void>

get

  • get(r: Request): Action<void>

Abstract getModel

  • getModel(): Model<T>

remove

  • remove(r: Request): Action<void>

search

  • search(r: Request): Action<void>

update

  • update(r: Request): Action<void>

Generated using TypeDoc