• Method that will set the ApiResponse structure

    • 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

    Parameters

    • APIHandler: APIHandler

      { callback, errorCode, hasValue = false }

    Returns string