Skip to content

Commit

Permalink
tesst
Browse files Browse the repository at this point in the history
  • Loading branch information
Ko71k committed Dec 16, 2024
1 parent 64a9d42 commit f3638a2
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions public/src/components/EventContentPage/EventContentPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,24 @@ export class EventContentPage {

async loadInvitations(container) {
try {
const response = await api.get('/profile/subscribe', {
credentials: 'include'
});
// const response = await api.get('/profile/subscribe', {
// credentials: 'include'
// });

if (!response.ok) {
throw new Error('Ошибка загрузки подписчиков');
}
// if (!response.ok) {
// throw new Error('Ошибка загрузки подписчиков');
// }


const invitations = await response.json();
// const invitations = await response.json();

const invitations = [
{
user_id: 4,
avatar: "static/images/zz4i9cz_RuifhJ3v_1732521149440.jpg",
username: 'wer'
}
];
container.innerHTML = ''; // Очищаем контейнер

if (invitations.length === 0) {
Expand Down Expand Up @@ -341,8 +350,7 @@ export class EventContentPage {

const requestBody = {
event_id: eventId,
user_id: userId,
inviter_id: inviterId
user_id: userId
};

const request = {
Expand All @@ -354,7 +362,7 @@ export class EventContentPage {
};
console.log(requestBody);
try {
const response = await api.post('/invite', request);
const response = await api.post('/notification', request);
if (response.ok) {
console.log('Приглашение отправлено');
} else {
Expand Down

0 comments on commit f3638a2

Please sign in to comment.