rework console client

This commit is contained in:
Artemy
2025-07-11 15:52:10 +07:00
parent 2ddc7ae699
commit 9d06984e8c
19 changed files with 312 additions and 67 deletions
@@ -32,14 +32,7 @@ namespace Govor.ConsoleClient.Commands
// Let's assume query parameter for now as it's simpler for HttpPost.
var response = await HttpClientService.PostAsync($"api/admin/Friendships?Id={friendshipId}", null);
if (response.StatusCode == System.Net.HttpStatusCode.Forbidden)
{
Console.WriteLine("[Ошибка] Доступ запрещен. Эта команда только для администраторов.");
return;
}
response.EnsureSuccessStatusCode();
Console.WriteLine($"Дружеская связь {friendshipId} успешно удалена.");
}
catch (HttpRequestException httpEx) when (httpEx.StatusCode == System.Net.HttpStatusCode.Forbidden)