Уточнить удаление каналов и обновить версии

Доработана серверная и клиентская логика удаления публичных каналов.

Обновлена документация API и форматов блокчейна.
This commit is contained in:
AidarKC
2026-10-06 19:09:56 +03:00
parent 83548a859f
commit acd5d4406d
12 changed files with 84 additions and 23 deletions
+4 -3
View File
@@ -102,17 +102,18 @@ async function resolveChannelSelector(route) {
const ownerUser = await authService.getUser(ownerLogin);
if (!ownerUser?.exists) throw new Error('Владелец канала не найден.');
const ownerBlockchainName = String(ownerUser.blockchainName || ownerRef).trim();
const ownerFeed = await authService.listSubscriptionsFeed(ownerLogin, 500);
const ownedRows = Array.isArray(ownerFeed?.ownedChannels) ? ownerFeed.ownedChannels : [];
const ownerLoginNormalized = ownerLogin.toLowerCase();
const row = ownedRows.find((item) => (
String(item?.channel?.channelName || '').trim().toLowerCase() === channelName.toLowerCase()
&& String(item?.channel?.ownerBlockchainName || '').trim().toLowerCase() === ownerBlockchainName.toLowerCase()
&& String(item?.channel?.ownerLogin || '').trim().toLowerCase() === ownerLoginNormalized
));
if (!row?.channel?.channelRoot) throw new Error('Канал не найден.');
const rootBlockchainName = String(row.channel.ownerBlockchainName || ownerRef).trim();
return {
ownerBlockchainName,
ownerBlockchainName: rootBlockchainName,
channelRootBlockNumber: Number(row.channel.channelRoot.blockNumber),
channelRootBlockHash: normalizeHash(row.channel.channelRoot.blockHash),
channelName,