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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user