Home Manual Reference Source

Repositories

Included in the SDK are multiple repositories to easily access data from the server. The repositories are initialized within the PVBidContext.

Available Repositories

These repositories are available as read-only (they should be modified through the pvbid application):

Code Examples

Retrieving an array of projects

let params = {
    order_by: "created_at",
    sort_order: "asc",
    per_page: 50
}

try {
    let projects = await pvbid.repositories.projects.get(params);
    console.log(projects) //prints an array of project data.
} catch(error) {
    //handle error;
}

Retrieving a line item definition

const lineItemDefId = 123;
try {
    const lineItemDef = await pvbid.repositories.lineItemDefs.findById(lineItemDefId);
} catch (e) {
    // handle error
}