6.3.0 • Published 3 years ago

tenant-app-shared-functions v6.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

tenant-app-shared-functions

This package content all functions that is used across services in tenant app

Installation

To install, run the code below:

npm install tenant-app-shared-functions

Functions

  • okHttpResponse:
    This is use to send ok http response to the client after an operation.
    syntax
    okHttpResponse(res, response, message='success')
    note: res is the express response object while response is the response you want to send to the client.

  • errorResponse:
    This is use to send Not_found http response to the client after an operation.
    syntax
    errorResponse(res, message)
    note: res is the express response object while message is the message you want to send to the client about the error.

Example 1:

(req, res) => {
    try {
        doSomething();
        okHttpResponse(res, response);
    }
    catch (e) {
        errorResponse(res, e.message)
    }
}

Example 2:

(req, res) => {
    try {
        doSomething();
        okHttpResponse(
            res,
            response,
            'operation was successful'
        );
    }
    catch (e) {
        errorResponse(res, e.message)
    }
}
5.3.2

3 years ago

5.3.1

3 years ago

5.3.0

3 years ago

5.1.0

3 years ago

5.0.0

3 years ago

6.1.0

3 years ago

6.0.0

3 years ago

6.3.0

3 years ago

6.2.1

3 years ago

6.1.2

3 years ago

6.2.0

3 years ago

6.1.1

3 years ago

4.1.7

3 years ago

6.1.4

3 years ago

6.1.3

3 years ago

4.1.6

3 years ago

4.1.5

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.2

3 years ago

4.1.1

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.0

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.0.9

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago