Interface containing the functions to extract the data from the response object. For example the getCollectionResult extracts the data from data.d.results per default but this needs to be adjusted in some situations.

interface ResponseDataAccessor {
    getCollectionResult: ((data) => any[]);
    getLinkedCollectionResult: ((data) => any[]);
    getSingleResult: ((data) => Record<string, any>);
    isCollectionResult: ((data) => boolean);
}

Properties

getCollectionResult: ((data) => any[])

A function that extracts array data from the response object. The data is extracted per default from data.d.results.

Type declaration

    • (data): any[]
    • Parameters

      • data: any

      Returns any[]

getLinkedCollectionResult: ((data) => any[])

Extract the collection data from the one-to-many link response. If the data does not contain a collection, an empty array is returned.

Type declaration

    • (data): any[]
    • Parameters

      • data: any

      Returns any[]

getSingleResult: ((data) => Record<string, any>)

A function that extracts object data from the response object. The data is extracted by default from data.d.results.

Type declaration

    • (data): Record<string, any>
    • Parameters

      • data: any

      Returns Record<string, any>

isCollectionResult: ((data) => boolean)

Checks if the response is an array-like object.

Copyright Ⓒ 2024 SAP SE or an SAP affiliate company. All rights reserved.

Type declaration

    • (data): boolean
    • Parameters

      • data: any

      Returns boolean