mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +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 {
|
return {
|
||||||
createPersonalAPIToken,
|
createPersonalAPIToken,
|
||||||
deletePersonalAPIToken,
|
deletePersonalAPIToken,
|
||||||
createUserPersonalAPIToken,
|
|
||||||
deleteUserPersonalAPIToken,
|
|
||||||
errors,
|
errors,
|
||||||
loading,
|
loading,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user