Skip to content

Commit

Permalink
фикс для сливания веток
Browse files Browse the repository at this point in the history
  • Loading branch information
oFem1m committed Apr 9, 2024
1 parent 4e982fb commit 7383ac8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Components/ChatListItem/ChatListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 статус');
}
Expand Down
22 changes: 15 additions & 7 deletions src/utils/API/ChatAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:',
Expand All @@ -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) {
Expand All @@ -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:',
Expand Down

0 comments on commit 7383ac8

Please sign in to comment.