Skip to content

Commit

Permalink
refactor: clean up no longer used PAT methods (#4621)
Browse files Browse the repository at this point in the history
This cleans up some PAT-related methods that are no longer used.
  • Loading branch information
nunogois authored Sep 7, 2023
1 parent 90395b9 commit cfbf47d
Showing 1 changed file with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,9 @@ export const usePersonalAPITokensApi = () => {
}
};

const createUserPersonalAPIToken = async (
userId: number,
payload: ICreatePersonalApiTokenPayload
): Promise<INewPersonalAPIToken> => {
const req = createRequest(`api/admin/user-admin/${userId}/pat`, {
method: 'POST',
body: JSON.stringify(payload),
});
try {
const response = await makeRequest(req.caller, req.id);
return await response.json();
} catch (e) {
throw e;
}
};

const deleteUserPersonalAPIToken = async (userId: number, id: string) => {
const req = createRequest(`api/admin/user-admin/${userId}/pat/${id}`, {
method: 'DELETE',
});
try {
await makeRequest(req.caller, req.id);
} catch (e) {
throw e;
}
};

return {
createPersonalAPIToken,
deletePersonalAPIToken,
createUserPersonalAPIToken,
deleteUserPersonalAPIToken,
errors,
loading,
};
Expand Down

0 comments on commit cfbf47d

Please sign in to comment.