How to use the odata.editLink function in odata

To help you get started, we’ve selected a few odata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SharePoint / PnP-JS-Core / src / sharepoint / rest / odata.ts View on Github external
function getEntityUrl(entity: any): string {

    if (entity.hasOwnProperty("__metadata")) {
        // we are dealing with verbose, which has an absolute uri
        return entity.__metadata.uri;
    } else if (entity.hasOwnProperty("odata.editLink")) {
        // we are dealign with minimal metadata (default)
        return Util.combinePaths("_api", entity["odata.editLink"]);
    } else {
        // we are likely dealing with nometadata, so don't error but we won't be able to
        // chain off these objects (write something to log?)
        Logger.write("No uri information found in ODataEntity parsing, chaining will fail for this object.", LogLevel.Warning);
        return "";
    }
}
github SharePoint / PnP-JS-Core / dist / pnp-provisioning.js View on Github external
function getEntityUrl(entity) {
    if (entity.hasOwnProperty("__metadata")) {
        return entity.__metadata.uri;
    }
    else if (entity.hasOwnProperty("odata.editLink")) {
        return util_1.Util.combinePaths("_api", entity["odata.editLink"]);
    }
    else {
        logging_1.Logger.write("No uri information found in ODataEntity parsing, chaining will fail for this object.", logging_1.LogLevel.Warning);
        return "";
    }
}
exports.ODataRaw = new ODataRawParserImpl();

odata

o.js is a isomorphic Odata Javascript library to simplify the request of data. The main goal is to build a standalone, lightweight and easy to understand Odata lib.

MIT
Latest version published 8 months ago

Package Health Score

65 / 100
Full package analysis