Api refactor, return object for createCommit
Signed-off-by: Erik Engervall <erik.engervall@gmail.com>
This commit is contained in:
@@ -366,8 +366,10 @@ export class GitReleaseApiClient implements GitReleaseApi {
|
||||
});
|
||||
|
||||
return {
|
||||
message: commit.message,
|
||||
sha: commit.sha,
|
||||
commit: {
|
||||
message: commit.message,
|
||||
sha: commit.sha,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -666,8 +668,10 @@ export interface GitReleaseApi {
|
||||
parents: string[];
|
||||
} & OwnerRepo,
|
||||
) => Promise<{
|
||||
message: string;
|
||||
sha: string;
|
||||
commit: {
|
||||
message: string;
|
||||
sha: string;
|
||||
};
|
||||
}>;
|
||||
|
||||
updateRef: (
|
||||
|
||||
@@ -97,7 +97,7 @@ export function usePatch({
|
||||
abortIfError(releaseBranchRes.error);
|
||||
if (!releaseBranchRes.value) return undefined;
|
||||
|
||||
const tempCommit = await pluginApiClient
|
||||
const { commit: tempCommit } = await pluginApiClient
|
||||
.createCommit({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
@@ -186,7 +186,7 @@ export function usePatch({
|
||||
const releaseBranchSha = releaseBranchRes.value.releaseBranch.commit.sha;
|
||||
const selectedPatchCommit = releaseBranchRes.value.selectedPatchCommit;
|
||||
|
||||
const cherryPickCommit = await pluginApiClient.createCommit({
|
||||
const { commit: cherryPickCommit } = await pluginApiClient.createCommit({
|
||||
owner: project.owner,
|
||||
repo: project.repo,
|
||||
message: `[patch ${bumpedTag}] ${selectedPatchCommit.commit.message}
|
||||
|
||||
@@ -260,8 +260,10 @@ export const mockApiClient: GitReleaseApi = {
|
||||
})),
|
||||
|
||||
createCommit: jest.fn(async () => ({
|
||||
message: 'mock_commit_message',
|
||||
sha: 'mock_commit_sha',
|
||||
commit: {
|
||||
message: 'mock_commit_message',
|
||||
sha: 'mock_commit_sha',
|
||||
},
|
||||
})),
|
||||
|
||||
updateRef: jest.fn(async () => ({
|
||||
|
||||
Reference in New Issue
Block a user