.net10 сервер с рабочими звонками и файлами

This commit is contained in:
Халимов Рустам
2026-03-12 01:48:58 +03:00
parent 50d4d75c04
commit d025c98e61
741 changed files with 35231 additions and 1863 deletions
+8 -7
View File
@@ -37,8 +37,9 @@ class ApiClient {
clearTimeout(timer);
if (!response.ok) {
const error = await response.json().catch(() => ({ error: '\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430' }));
throw new Error(error.error || '\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430');
const errorData = await response.json().catch(() => ({}));
const errorMessage = errorData.error || errorData.message || 'Ошибка запроса';
throw new Error(errorMessage);
}
return response.json();
@@ -106,7 +107,7 @@ class ApiClient {
async searchMessages(query: string, chatId?: string) {
const params = new URLSearchParams({ q: query });
if (chatId) params.append('chatId', chatId);
return this.request<Message[]>(`/users/messages/search?${params}`);
return this.request<Message[]>(`/messages/search?${params}`);
}
// \u0427\u0430\u0442\u044b
@@ -215,10 +216,6 @@ class ApiClient {
return this.request<Message[]>(`/messages/chat/${chatId}/shared?type=${type}`);
}
// ICE серверы для WebRTC
async getIceServers() {
return this.request<{ iceServers: RTCIceServer[] }>('/ice-servers');
}
// Stories
async getStories() {
@@ -292,6 +289,10 @@ class ApiClient {
async removeFriend(friendshipId: string) {
return this.request<{ success: boolean }>(`/friends/${friendshipId}`, { method: 'DELETE' });
}
async getIceServers() {
return this.request<{ iceServers: RTCIceServer[] }>('/webrtc/ice-servers');
}
}
export const api = new ApiClient();