Api refactor, return object for getComparison
Signed-off-by: Erik Engervall <erik.engervall@gmail.com>
This commit is contained in:
@@ -282,8 +282,10 @@ export class GitReleaseApiClient implements GitReleaseApi {
|
||||
});
|
||||
|
||||
return {
|
||||
htmlUrl: compareCommitsResponse.data.html_url,
|
||||
aheadBy: compareCommitsResponse.data.ahead_by,
|
||||
comparison: {
|
||||
htmlUrl: compareCommitsResponse.data.html_url,
|
||||
aheadBy: compareCommitsResponse.data.ahead_by,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -617,8 +619,10 @@ export interface GitReleaseApi {
|
||||
head: string;
|
||||
} & OwnerRepo,
|
||||
) => Promise<{
|
||||
htmlUrl: string;
|
||||
aheadBy: number;
|
||||
comparison: {
|
||||
htmlUrl: string;
|
||||
aheadBy: number;
|
||||
};
|
||||
}>;
|
||||
|
||||
createRelease: (
|
||||
|
||||
+1
-1
@@ -197,7 +197,7 @@ export function useCreateReleaseCandidate({
|
||||
? latestRelease.targetCommitish
|
||||
: defaultBranch;
|
||||
const nextReleaseBranch = releaseCandidateGitInfo.rcBranch;
|
||||
const comparison = await pluginApiClient
|
||||
const { comparison } = await pluginApiClient
|
||||
.getComparison({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
|
||||
@@ -244,8 +244,10 @@ export const mockApiClient: GitReleaseApi = {
|
||||
})),
|
||||
|
||||
getComparison: jest.fn(async () => ({
|
||||
htmlUrl: 'mock_compareCommits_html_url',
|
||||
aheadBy: 1,
|
||||
comparison: {
|
||||
htmlUrl: 'mock_compareCommits_html_url',
|
||||
aheadBy: 1,
|
||||
},
|
||||
})),
|
||||
|
||||
createTagObject: jest.fn(async () => ({
|
||||
|
||||
Reference in New Issue
Block a user