fix(aio): remove unnecessary repoSlug parameter from GithubApi

This commit is contained in:
Georgios Kalpakas
2017-02-28 14:17:20 +02:00
committed by Chuck Jazdzewski
parent 951e653b0c
commit 060d02eb82
5 changed files with 20 additions and 19 deletions

View File

@ -40,7 +40,7 @@ export class BuildCleaner {
}
protected getOpenPrNumbers(): Promise<number[]> {
const githubPullRequests = new GithubPullRequests(this.repoSlug, this.githubToken);
const githubPullRequests = new GithubPullRequests(this.githubToken, this.repoSlug);
return githubPullRequests.
fetchAll('open').

View File

@ -18,8 +18,7 @@ export class GithubApi {
protected requestHeaders: {[key: string]: string};
// Constructor
constructor(protected repoSlug: string, githubToken: string) {
assertNotMissingOrEmpty('repoSlug', repoSlug);
constructor(githubToken: string) {
assertNotMissingOrEmpty('githubToken', githubToken);
this.requestHeaders = {

View File

@ -1,4 +1,5 @@
// Imports
import {assertNotMissingOrEmpty} from '../common/utils';
import {GithubApi} from './github-api';
// Interfaces - Types
@ -10,6 +11,12 @@ export type PullRequestState = 'all' | 'closed' | 'open';
// Classes
export class GithubPullRequests extends GithubApi {
// Constructor
constructor(githubToken: string, protected repoSlug: string) {
super(githubToken);
assertNotMissingOrEmpty('repoSlug', repoSlug);
}
// Methods - Public
public addComment(pr: number, body: string): Promise<void> {
if (!(pr > 0)) {