@argodigital/formula-response

Handles data (or error) response returned by handler. Provides unified shape of response for all **formula** services.

Usage no npm install needed!

<script type="module">
  import argodigitalFormulaResponse from 'https://cdn.skypack.dev/@argodigital/formula-response';
</script>

README

formula-response

Handles data (or error) response returned by handler. Provides unified shape of response for all formula services.

Customization

By default response will return data with status code 200 or an error with status code matching code in statuses package (see errors package for error customization).

In addition, response can be customized through input of formula-sl-function and responseOptions object. In example:

postUser:
    component: "@argodigital/formula-sl-function"
    responseOptions:
        statusCode: 201
        attributes:
            - name
            - email
            - dob
        id: userId

More options are listed on jsonapi-serializer package page.