diff --git a/src/Components/ChatListItem/ChatListItem.js b/src/Components/ChatListItem/ChatListItem.js index 340cc43..0066ce3 100644 --- a/src/Components/ChatListItem/ChatListItem.js +++ b/src/Components/ChatListItem/ChatListItem.js @@ -35,7 +35,7 @@ export default class ChatListItem extends BaseComponent { .then((data) => { if (data.status === 200) { // Обработка успешной авторизации - goToPage('/chat'); + goToPage('/chat', true); } else { throw new Error('Пришел не 200 статус'); } diff --git a/src/utils/API/ChatAPI.js b/src/utils/API/ChatAPI.js index e0ce5d2..247fd48 100644 --- a/src/utils/API/ChatAPI.js +++ b/src/utils/API/ChatAPI.js @@ -25,9 +25,13 @@ export class ChatAPI { async chatByUserId(UserId) { try { - return makeBaseRequest(`${baseUrl}/createPrivateChat`, 'POST', { - user_id: UserId, - }); + return makeBaseRequest( + `${protocol}://${baseUrl}/createPrivateChat`, + 'POST', + { + user_id: UserId, + }, + ); } catch (error) { console.error( 'There was a problem with the fetch operation:', @@ -39,7 +43,7 @@ export class ChatAPI { async chatById(ChatId) { try { - return makeBaseRequest(`${baseUrl}/getChat`, 'POST', { + return makeBaseRequest(`${protocol}://${baseUrl}/getChat`, 'POST', { chat_id: ChatId, }); } catch (error) { @@ -53,9 +57,13 @@ export class ChatAPI { async deleteChatById(ChatId) { try { - return makeBaseRequest(`${baseUrl}/deleteChat`, 'POST', { - chat_id: ChatId, - }); + return makeBaseRequest( + `${protocol}://${baseUrl}/deleteChat`, + 'POST', + { + chat_id: ChatId, + }, + ); } catch (error) { console.error( 'There was a problem with the fetch operation:',