3.1.4 • Published 2 years ago

@brunomon/odata-fetch-factory v3.1.4

Weekly downloads
8
License
MIT
Repository
github
Last release
2 years ago

@BrunoMon/odata-fetch-factory

npm GitHub issues GitHub

fetch function setted for odata V4 endpoint

Install

$ npm install @brunomon/odata-fetch-factory

Usage

import {
    ODataFetchFactory,
    ODataEntity
} from "@brunomon/odata-fetch-factory";


const myOdataService = ODataFetchFactory({
    fetch: fetch,
    domain: "http://myDomain/myOdataService"
});

const cities = ODataEntity(myOdataService, "cities")

cities.get({
    filter: "State eq 'Florida'",
    orderby: "Name"
}).then(data => {
    console.log(data)
}).catch(err=>{
    console.log(err)
})

cities.post({
    Name: "Miami",
    State: "Florida"
}).then(data => {
    console.log(data)
}).catch(err=>{
    console.log(err)
})

cities.put({
    Id: 5,
    Name: "Miami",
    state:"Florida"
}).then(data => {
    console.log(data)
}).catch(err=>{
    console.log(err)
})

cities.patch({
    Id: 5,
    state:"Texas"
}).then(data => {
    console.log(data)
}).catch(err=>{
    console.log(err)
})

cities.delete({
    Id: 5
}).then(data => {
    console.log(data)
}).catch(err=>{
    console.log(err)
})
3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.1.4

2 years ago

3.1.0

3 years ago

3.0.0

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago