Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Florencia-97 committed Jun 10, 2024
1 parent f0de682 commit 702f8e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/endpoints/Endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class Endpoint {
}

static newGet({url, ownResponses, needsAuthorization, contentType, responseContentType}) {
return Endpoint.newFor({
return this.newFor({
url,
ownResponses,
needsAuthorization,
Expand All @@ -40,7 +40,7 @@ export default class Endpoint {
}

static newPost({url, ownResponses, needsAuthorization, contentType, responseContentType}) {
return Endpoint.newFor({
return this.newFor({
url,
ownResponses,
needsAuthorization,
Expand All @@ -51,7 +51,7 @@ export default class Endpoint {
}

static newPut({url, ownResponses, needsAuthorization, contentType, responseContentType}) {
return Endpoint.newFor({
return this.newFor({
url,
ownResponses,
needsAuthorization,
Expand All @@ -62,7 +62,7 @@ export default class Endpoint {
}

static newDelete({url, ownResponses, needsAuthorization, contentType, responseContentType}) {
return Endpoint.newFor({
return this.newFor({
url,
ownResponses,
needsAuthorization,
Expand All @@ -73,7 +73,7 @@ export default class Endpoint {
}

static newPatch({url, ownResponses, needsAuthorization, contentType, responseContentType}) {
return Endpoint.newFor({
return this.newFor({
url,
ownResponses,
needsAuthorization,
Expand All @@ -94,7 +94,7 @@ export default class Endpoint {
});
}

getContentFromResponse(response) {
convertBodyResponse(response) {
// Response will be responsible for this in the future
if (this._responseContentType === Endpoint.CONTENT_TYPE_JSON) {
return response.json();
Expand Down
2 changes: 1 addition & 1 deletion src/requester/RemoteRequester.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class RemoteRequester extends Requester {

return fetch(this._baseUrl + "/" + url, request)
.then((result) => {
return endpoint.getContentFromResponse(result);
return endpoint.convertBodyResponse(result);
})
.then(jsonResponse => {
return this._buildResponse(jsonResponse, endpoint)
Expand Down

0 comments on commit 702f8e4

Please sign in to comment.