Skip to content

Commit

Permalink
FP-3061 + FP-2989
Browse files Browse the repository at this point in the history
  • Loading branch information
quirinpa committed Nov 21, 2024
1 parent 2213eb3 commit 25bc344
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TBD

- [FP-3061](https://movai.atlassian.net/browse/FP-3061): Release of mutex lock does not work
- [FP-2989](https://movai.atlassian.net/browse/FP-2989): ADMIN BOARD - Unclear message to user creation failure
- [FP-2916](https://movai.atlassian.net/browse/FP-2916): Configure husky, lint-staged and prettier for lib-core

# 1.2.3
Expand Down
12 changes: 5 additions & 7 deletions src/api/Rest/RestBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RestBase.getUrl = ({ path, search = {} }) => {
* @param {String} method - Request method
* @param {Object} body - Request payload
*/
RestBase._request = ({
RestBase._request = async ({
url,
path,
method = "GET",
Expand All @@ -53,12 +53,10 @@ RestBase._request = ({

if (!skipBody.includes(method)) payload.body = JSON.stringify(body);

return fetch(requestUrl, payload).then((response) => {
if (!response.ok) {
return Promise.reject(response);
}
return response.json();
});
const response = await fetch(requestUrl, payload);

if (!response.ok) throw new Error(await response.text());
else return await response.json();
};

/**
Expand Down

0 comments on commit 25bc344

Please sign in to comment.