mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
refactor: clean up no longer used PAT methods (#4621)
This cleans up some PAT-related methods that are no longer used.
This commit is contained in:
parent
90395b974b
commit
cfbf47d6bd
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user