    import ProjectRepository from 'pvbid-sdk/src/repositories/ProjectRepository.js'

public class | source

# ProjectRepository

#### Extends:

BaseRepository → ProjectRepository

## Constructor Summary

Public Constructor
public | constructor() |

## Method Summary

Public Methods
public | async attachBid(projectId: number, bidId: number): Promise<Object> Adds a bid to a project |
public | async attachUser(projectId: number, userId: number): Promise<Object> Adds a user to a project |
public | async batchUpdate(projectId: number, data: Object): Promise<Object> Allows persistance of underlying bid data along with project |
public | async clone(projectId: number): Promise<BidEntity> Clones a project |
public | async detachBid(projectId: number, bidId: number): Promise<Object> Removes a bid from a project |
public | async detachUser(projectId: number, userId: number): Promise<Object> Removes a user from a project |
public | async get(params: Object): Promise<BidEntity[]> Retrieves a list of projects |

## Inherited Summary

From class BaseRepository
public | endpoint: * |
public | http: * |
public | httpConfig: * |
public | map: {"single": *, "multi": *} |
public | metaData: * |
public | params: {} |
public | async create(entity: BidEntity): Promise<BidEntity> Persists a new entity |
public | async delete(id: number): Promise<Object> Deletes a single entity by its id |
public | async findById(id: number): Promise<BidEntity> Retrieves a single domain object by its id. |
public | async get(params: Object): Promise<BidEntity[]> Retrieves an array of results for the endpoint |
public | async save(entity: BidEntity): Promise<BidEntity> Persists an update to the entity |

## Public Constructors

### public constructor() source

Creates an instance of BaseRepository.

#### Override:

BaseRepository#constructor

## Public Methods

### public async attachBid(projectId: number, bidId: number): Promise<Object> source

Adds a bid to a project

#### Params:

Name | Type | Attribute | Description
projectId | number |  | The project's id
bidId | number |  | The bid's id

#### Return:

Promise<Object> | API response status

### public async attachUser(projectId: number, userId: number): Promise<Object> source

Adds a user to a project

#### Params:

Name | Type | Attribute | Description
projectId | number |  | The project's id
userId | number |  | The user's id

#### Return:

Promise<Object> | API response status

### public async batchUpdate(projectId: number, data: Object): Promise<Object> source

Allows persistance of underlying bid data along with project

#### Params:

Name | Type | Attribute | Description
projectId | number |  |
data | Object |  | The project data to update

#### Return:

Promise<Object> | The API response

### public async clone(projectId: number): Promise<BidEntity> source

Clones a project

#### Params:

Name | Type | Attribute | Description
projectId | number |  |

#### Return:

Promise<BidEntity> | Project clone

### public async detachBid(projectId: number, bidId: number): Promise<Object> source

Removes a bid from a project

#### Params:

Name | Type | Attribute | Description
projectId | number |  | The project's id
bidId | number |  | The bid's id

#### Return:

Promise<Object> | API response status

### public async detachUser(projectId: number, userId: number): Promise<Object> source

Removes a user from a project

#### Params:

Name | Type | Attribute | Description
projectId | number |  | The project's id
userId | number |  | The user's id

#### Return:

Promise<Object> | API response status

### public async get(params: Object): Promise<BidEntity[]> source

Retrieves a list of projects

#### Override:

BaseRepository#get

#### Params:

Name | Type | Attribute | Description

params

Object

- optional

A set of parameters to filter the projects by.

params.per_page | number |  | Number of projects to to display per request (max 100)
params.page | number |  | Page number
params.search | string |  | Search term to apply to project's title
params.sort_order | string |  | 'asc' or 'desc'
params.order_by | string |  | The name of the property to sort the results by
params.tag_ids | number[] |  | List of tags to filter by (excluding this will include all tags)
params.user_ids | number[] |  | List of users to filter by (excluding this will include all users)

#### Return:

Promise<BidEntity[]> | Filtered list of projects