chetajs
Version:
Chetajs is a NodeJS cli generator for scaffolding ExpressJs applications
28 lines (26 loc) • 648 B
JavaScript
export class Response
{
constructor(message = "", data = null, isSuccess = true)
{
this.status = isSuccess;
this.message = message;
switch (isSuccess) {
case true:
this.data = data
break;
case false:
this.error = data
break;
default:
break;
}
}
// response = () => {
// let response = {
// status: this.status,
// message: this.type,
// data: this.data
// }
// return response
// }
}