update
This commit is contained in:
@@ -562,8 +562,36 @@ export async function fetchDocumentPhotoUrl(userId: string, storageKey: string,
|
||||
return apiFetch<MediaAccessResponse>(`/media/users/${userId}/documents/photo-url?${query.toString()}`, {}, token);
|
||||
}
|
||||
|
||||
export interface AccountDeletionStatus {
|
||||
pending: boolean;
|
||||
deletionRequestedAt?: string;
|
||||
effectiveAt?: string;
|
||||
graceDays: number;
|
||||
}
|
||||
|
||||
export async function requestAccountDeletion(userId: string, token?: string | null) {
|
||||
return apiFetch<AccountDeletionStatus & { userId: string }>(
|
||||
`/profile/users/${userId}/self-delete`,
|
||||
{ method: 'POST' },
|
||||
token
|
||||
);
|
||||
}
|
||||
|
||||
export async function cancelAccountDeletion(userId: string, token?: string | null) {
|
||||
return apiFetch<{ userId: string; cancelled: boolean }>(
|
||||
`/profile/users/${userId}/self-delete/cancel`,
|
||||
{ method: 'POST' },
|
||||
token
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchAccountDeletionStatus(userId: string, token?: string | null) {
|
||||
return apiFetch<AccountDeletionStatus>(`/profile/users/${userId}/self-delete/status`, {}, token);
|
||||
}
|
||||
|
||||
/** @deprecated Используйте requestAccountDeletion — удаление теперь отложенное */
|
||||
export async function softDeleteProfile(userId: string, token?: string | null) {
|
||||
return apiFetch<{ success: boolean }>(`/profile/users/${userId}/self-delete`, { method: 'POST' }, token);
|
||||
return requestAccountDeletion(userId, token);
|
||||
}
|
||||
|
||||
export interface UserAddress {
|
||||
@@ -726,6 +754,10 @@ export async function updateFamilyGroup(groupId: string, name: string, token?: s
|
||||
return apiFetch<FamilyGroup>(`/family/groups/${groupId}`, { method: 'PATCH', body: JSON.stringify({ name }) }, token);
|
||||
}
|
||||
|
||||
export async function deleteFamilyGroup(groupId: string, token?: string | null) {
|
||||
return apiFetch<{ count: number }>(`/family/groups/${groupId}`, { method: 'DELETE' }, token);
|
||||
}
|
||||
|
||||
export async function sendFamilyInvite(groupId: string, payload: { inviteeUserId: string; target?: string }, token?: string | null) {
|
||||
return apiFetch<FamilyInvite>(`/family/groups/${groupId}/invites`, { method: 'POST', body: JSON.stringify(payload) }, token);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,14 @@ export const SYSTEM_SETTING_CATALOG: SystemSettingMeta[] = [
|
||||
{ key: 'PIN_MAX_LENGTH', label: 'Макс. длина PIN', group: 'pin', type: 'number', unit: 'цифр' },
|
||||
{ key: 'OTP_EXPIRY_MINUTES', label: 'Срок жизни OTP', group: 'auth', type: 'number', unit: 'мин' },
|
||||
{ key: 'OTP_MAX_ATTEMPTS', label: 'Попыток ввода OTP', group: 'auth', type: 'number' },
|
||||
{
|
||||
key: 'ACCOUNT_DELETE_GRACE_DAYS',
|
||||
label: 'Отложенное удаление аккаунта',
|
||||
group: 'auth',
|
||||
type: 'number',
|
||||
unit: 'дн',
|
||||
hint: 'Срок ожидания перед окончательным удалением профиля после запроса пользователя'
|
||||
},
|
||||
{ key: 'SESSION_REFRESH_DAYS', label: 'Срок refresh-токена', group: 'auth', type: 'number', unit: 'дн' },
|
||||
{ key: 'PASSWORD_MIN_LENGTH', label: 'Мин. длина пароля', group: 'auth', type: 'number', unit: 'симв' },
|
||||
{ key: 'REGISTRATION_ENABLED', label: 'Регистрация включена', group: 'auth', type: 'boolean' },
|
||||
|
||||
Reference in New Issue
Block a user