Skip to content

Commit

Permalink
Merge pull request #24 from nulab/wrong-url-and-parameter
Browse files Browse the repository at this point in the history
Fix url and parameter
  • Loading branch information
mmktomato authored Dec 28, 2020
2 parents 2d161ff + 6d14682 commit f87fac5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dist/backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var Backlog = (function (_super) {
return this.get("users/" + userId + "/stars", params);
};
Backlog.prototype.getUserStarsCount = function (userId, params) {
return this.get("users/" + userId + "/count", params);
return this.get("users/" + userId + "/stars/count", params);
};
Backlog.prototype.getRecentlyViewedIssues = function (params) {
return this.get('users/myself/recentlyViewedIssues', params);
Expand Down Expand Up @@ -281,8 +281,8 @@ var Backlog = (function (_super) {
Backlog.prototype.unlinkIssueSharedFile = function (issueIdOrKey, id) {
return this.delete("issues/" + issueIdOrKey + "/sharedFiles/" + id);
};
Backlog.prototype.getWikis = function (projectIdOrKey) {
return this.get("wikis", { projectIdOrKey: projectIdOrKey });
Backlog.prototype.getWikis = function (params) {
return this.get("wikis", params);
};
Backlog.prototype.getWikisCount = function (projectIdOrKey) {
return this.get("wikis/count", { projectIdOrKey: projectIdOrKey });
Expand Down Expand Up @@ -375,7 +375,7 @@ var Backlog = (function (_super) {
return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/comments/count");
};
Backlog.prototype.patchPullRequestComments = function (projectIdOrKey, repoIdOrName, number, commentId, params) {
return this.patch("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/" + commentId, params);
return this.patch("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/comments/" + commentId, params);
};
Backlog.prototype.getPullRequestAttachments = function (projectIdOrKey, repoIdOrName, number) {
return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/attachments");
Expand Down
2 changes: 1 addition & 1 deletion dist/backlog.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/backlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default class Backlog extends Request {
public getUserStarsCount(
userId: number, params: Option.User.GetUserStarsCountParams
): Promise<any> {
return this.get(`users/${userId}/count`, params);
return this.get(`users/${userId}/stars/count`, params);
}

/**
Expand Down Expand Up @@ -713,8 +713,8 @@ export default class Backlog extends Request {
/**
* 88: https://developer.nulab-inc.com/ja/docs/backlog/api/2/get-wiki-page-list/
*/
public getWikis(projectIdOrKey: number): Promise<any> {
return this.get(`wikis`, { projectIdOrKey });
public getWikis(params: Option.Wiki.GetWikiParams): Promise<any> {
return this.get(`wikis`, params);
}

/**
Expand Down Expand Up @@ -978,7 +978,7 @@ export default class Backlog extends Request {
commentId: number,
params: Option.PullRequest.PatchPullRequestCommentsParams
): Promise<any> {
return this.patch(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/${commentId}`, params);
return this.patch(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments/${commentId}`, params);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,11 @@

export namespace Wiki {

export interface GetWikiParams {
projectIdOrKey: number;
keyword?: string;
}

export interface PostWikiParams {
projectId: number;
name: string;
Expand Down

0 comments on commit f87fac5

Please sign in to comment.