Class: Success

Success(data, message)

new Success(data, message)

Creates a new instance of the Success class.

Parameters:
Name Type Description
data Object

The data object to be included in the response.

message string

The success message to be included in the response.

Source:

Members

data

The data object included in the response.

Properties:
Type Description
Object
Source:

message

The success message included in the response.

Properties:
Type Description
string
Source:

success

A flag indicating the success of the API response.

Properties:
Type Description
boolean
Source:

Methods

toJSON() → {string}

Converts the Success object to a JSON string.

Source:
Throws:
  • Throws an error if JSON stringification fails.
Type
Error
Returns:
  • The JSON representation of the Success object.
Type
string