Adding deployments API

This commit is contained in:
Justin 2018-03-29 14:53:24 -04:00
parent 22f825f17e
commit f4da9d8ce9
3 changed files with 19 additions and 0 deletions

View File

@ -30,6 +30,7 @@ export const ProjectsBundle = init(Pick(APIServices, [
'Branches',
'Commits',
'DeployKeys',
'Deployments',
'Environments',
'Issues',
'Jobs',

View File

@ -0,0 +1,17 @@
import { BaseService, RequestHelper } from '../infrastructure';
class Deployments extends BaseService {
all(projectId, options) {
const pId = encodeURIComponent(projectId);
return RequestHelper.get(this, `projects/${pId}/deployments`, options);
}
show(projectId, deploymentId) {
const [pId, dId] = [projectId, deploymentId].map(encodeURIComponent);
return RequestHelper.post(this, `projects/${pId}/deployments/${dId}`);
}
}
export default Deployments;

View File

@ -17,6 +17,7 @@ export UserGPGKeys from './UserGPGKeys';
// Projects
export Branches from './Branches';
export Commits from './Commits';
export Deployments from './Deployments';
export DeployKeys from './DeployKeys';
export Environments from './Environments';
export Issues from './Issues';