Skip to content

TResponse object

The TResponse object is usually a type of the data field in the RequestResponse. There are currently three basic types of a TResponse.

TResponseWithFlashMessenger

type TResponseWithFlashMessenger = {
    flashMessages: TFlashMessenger;
}

TResponseWithFlashMessenger has one property called flashMessages which has the type of TFlashMessenger.

TResponseWithStatus

type TResponseWithStatus = {
    status: TResponseStatus;
}

TResponseWithStatus has one property called status which has the type of TResponseStatus.

TResponseWithId

type TResponseWithId = {
    id: number;
}

TResponseWithId has one property called id which has the type of number.

TResponseWithMessagesAndStatus

type TResponseWithMessagesAndStatus = TResponseWithFlashMessenger & TResponseWithStatus

TResponseWithMessagesAndStatus has two properties:

TResponseWithMessagesStatusAndId

type TResponseWithMessagesStatusAndId = TResponseWithMessagesAndStatus & TResponseWithId;

TResponseWithMessagesAndStatus has three properties:

TResponseStatus

type TResponseStatus = {
    success: 'success',
    failed: 'failed'
}

TResponseStatus has two properties, success and failed.

Objects reference