Skip to content

Commit 074202e

Browse files
committed
approve method added with merge param
1 parent af379b2 commit 074202e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/components/TestDetailsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const TestDetailsModal: React.FunctionComponent<{
157157
<Button
158158
color="inherit"
159159
onClick={() =>
160-
testRunService.approve(testRun.id).then((testRun) => {
160+
testRunService.approve(testRun.id, testRun.merge).then((testRun) => {
161161
updateTestRun(testRunDispatch, testRun);
162162
})
163163
}

src/services/testRun.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ function recalculateDiff(id: string): Promise<TestRun> {
5050
).then(handleResponse);
5151
}
5252

53-
function approve(id: string): Promise<TestRun> {
53+
function approve(id: string, merge: boolean): Promise<TestRun> {
5454
const requestOptions = {
5555
method: "GET",
5656
headers: authHeader(),
5757
};
5858

59-
return fetch(`${API_URL}${ENDPOINT_URL}/approve/${id}`, requestOptions).then(
60-
handleResponse
61-
);
59+
return fetch(
60+
`${API_URL}${ENDPOINT_URL}/approve?id=${id}&merge=${merge}`,
61+
requestOptions
62+
).then(handleResponse);
6263
}
6364

6465
function reject(id: string): Promise<TestRun> {

src/types/testRun.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ export interface TestRun {
1919
comment?: string;
2020
branchName: string;
2121
baselineBranchName: string;
22+
merge: boolean;
2223
}

0 commit comments

Comments
 (0)