roles update
This commit is contained in:
@@ -133,6 +133,19 @@ export default function AdminOAuthPage() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeleteClient(client: OAuthClient) {
|
||||
if (!token) return;
|
||||
if (!window.confirm(`Удалить приложение «${client.name}»? Это действие необратимо.`)) return;
|
||||
try {
|
||||
await apiFetch(`/admin/rbac/oauth-clients/${client.clientId}`, { method: 'DELETE' }, token);
|
||||
showToast('Приложение удалено');
|
||||
setSelectedClient(null);
|
||||
await loadData();
|
||||
} catch (error) {
|
||||
showToast(error instanceof Error ? error.message : 'Не удалось удалить приложение');
|
||||
}
|
||||
}
|
||||
|
||||
function copyText(value: string, label: string) {
|
||||
void navigator.clipboard.writeText(value);
|
||||
showToast(`${label} скопирован`);
|
||||
@@ -213,6 +226,7 @@ export default function AdminOAuthPage() {
|
||||
onCopy={copyText}
|
||||
onRotateSecret={(clientId) => void handleRotateSecret(clientId)}
|
||||
onToggleActive={(client) => void handleToggleActive(client)}
|
||||
onDelete={(client) => void handleDeleteClient(client)}
|
||||
/>
|
||||
|
||||
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
||||
|
||||
Reference in New Issue
Block a user