outsystems-ui - v3.0.0
    Preparing search index...

    Function CreateApiResponse

    • Method that will set the ApiResponse structure

      Parameters

      • APIHandler: APIHandler

        { callback, errorCode, hasValue = false }

        • callback

          the logic to run and ensure there is no error on it, otherwise, catch that error message

        • errorCode

          the error code to show when the given callback didn't perform

        • hasValue

          if the callback code will return a value

      Returns string

      the API response envelope as a JSON string: { code, isSuccess, message, value? }