Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
* merging
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuettner Tobias committed Mar 24, 2020
2 parents 3f53dd8 + b6660ca commit bf13ac2
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions client/src/api/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,23 @@ class Api {
}

getTestReports(testId) {
return this.executeRequest(`/test_report/${testId}`, METHOD.GET);
return this.executeRequest(`/test_reports/${testId}`, METHOD.GET);
}

// TODO: postTestReport, putTestReport | how to handle multipart/form-data in fetch ?!
postTestReport(id, file) {
const data = new FormData();
data.append("file", file);

return fetch(`${this.BASE_URL}/test_reports/${encodeURI(id)}`, {
method: "POST",
body: data
}).then(response => {
return response.json();
});
}

getTestReport(testId) {
return this.executeRequest(`/test_report/${testId}`, METHOD.GET);
return this.executeRequest(`/test_reports/${testId}`, METHOD.GET);
}

deleteTestReport(testId) {
Expand Down

0 comments on commit bf13ac2

Please sign in to comment.