Skip to content

Commit

Permalink
refactor: bubble promise instead of return await (#4906)
Browse files Browse the repository at this point in the history
Tiny refactor that bubbles promises instead of using `return await`.
Should be more consistent with the rest of the changes in
#4903
  • Loading branch information
nunogois committed Oct 2, 2023
1 parent 4167a60 commit 280e21f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Expand Up @@ -25,7 +25,7 @@ const useAddonsApi = () => {
method: 'DELETE',
});

return await makeRequest(req.caller, req.id);
return makeRequest(req.caller, req.id);
};

const updateAddon = useCallback(
Expand Down
Expand Up @@ -20,7 +20,7 @@ export const useInviteTokenApi = () => {
body: JSON.stringify(request),
});

return await makeRequest(req.caller, req.id);
return makeRequest(req.caller, req.id);
},
[createRequest, makeRequest],
);
Expand All @@ -37,7 +37,7 @@ export const useInviteTokenApi = () => {
}),
});

return await makeRequest(req.caller, req.id);
return makeRequest(req.caller, req.id);
},
[createRequest, makeRequest],
);
Expand All @@ -49,7 +49,7 @@ export const useInviteTokenApi = () => {
body: JSON.stringify(value),
});

return await makeRequest(req.caller, req.id);
return makeRequest(req.caller, req.id);
},
[createRequest, makeRequest],
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/api/actions/useRolesApi/useRolesApi.ts
Expand Up @@ -24,7 +24,7 @@ export const useRolesApi = () => {
);

const response = await makeRequest(req.caller, req.id);
return await response.json();
return response.json();
};

const updateRole = async (roleId: number, role: IRolePayload) => {
Expand Down
Expand Up @@ -25,7 +25,7 @@ export const useServiceAccountsApi = () => {
);

const response = await makeRequest(req.caller, req.id);
return await response.json();
return response.json();
};

const removeServiceAccount = async (serviceAccountId: number) => {
Expand Down

0 comments on commit 280e21f

Please sign in to comment.