mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
fix: hold the ratchets after the SSO unlink and the day pager window
- The SSO unlink answers with a response contract (adminSsoUnlinkResponseSchema). - It reuses linkOidcIdentity with nulls instead of a new repository method, so UsersRepository keeps its method count and size. - The client calls the route through apiClient, so api/client.ts does not grow, and its confirm dialog takes no async callback. - The pager's preview step and pagesFor keep their complexity.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { adminApi } from '../../api/client';
|
||||
import { adminApi, apiClient } from '../../api/client';
|
||||
import type { TranslationFn } from '../../types';
|
||||
|
||||
interface UserActionsHost {
|
||||
@@ -58,7 +58,7 @@ export function useAdminUserActions(admin: UserActionsHost, t: TranslationFn) {
|
||||
/** Forgets the user's SSO identity so the next SSO sign-in links again (#3065); true when it worked. */
|
||||
const unlinkSso = async (user: { id: number }): Promise<boolean> => {
|
||||
try {
|
||||
await adminApi.unlinkUserSso(user.id);
|
||||
await apiClient.delete(`/admin/users/${user.id}/sso`);
|
||||
toast.success(t('admin.sso.unlinkDone'));
|
||||
return true;
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user