Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP-3061 + FP-2989 #207

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/api/LockManager/LockManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class LockManager {
* Execute DELETE request
*/
delete = ({ lockName, robotId }: { lockName: string; robotId: string }) => {
const path = `v1/${lockName}/${robotId}/`;
const path = `v1/lock/${lockName}/`;
return Rest.delete({ path });
};

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
Loading