diff --git a/public/components/EventContentPage/EventContentPage.js b/public/components/EventContentPage/EventContentPage.js
index d504948..6d37e84 100644
--- a/public/components/EventContentPage/EventContentPage.js
+++ b/public/components/EventContentPage/EventContentPage.js
@@ -111,9 +111,14 @@ export class EventContentPage {
deleteButton.className = 'buttonDelete';
deleteButton.textContent = 'Удалить мероприятие';
deleteButton.addEventListener("click", async () => {
- response = await api.delete(event, event);
+ const request = {
+ headers: {
+ },
+ credentials: 'include',
+ };
+ response = await api.delete(`/event/${event.id}`, request);
console.log(response);
- //navigate("/profile", event);
+ navigate('/events');
});
const editButton = document.createElement('button');
diff --git a/public/components/EventCreateForm/EventCreateForm.js b/public/components/EventCreateForm/EventCreateForm.js
index cee5ad8..1d68a01 100644
--- a/public/components/EventCreateForm/EventCreateForm.js
+++ b/public/components/EventCreateForm/EventCreateForm.js
@@ -241,7 +241,7 @@ export class EventCreateForm {
renderTemplate(selectElement) {
const template = Handlebars.templates['EventCreateForm.hbs'];
-
+
const config = this.config;
let itemsArray = Object.entries(config);
let items = itemsArray.map(([key, {tag, text, className, type}], index) => {
@@ -249,7 +249,7 @@ export class EventCreateForm {
let needMaxMinTime = (type === 'time');
return {key, tag, text, className, type, needPlaceholder, needMaxMinTime};
});
- console.log(items);
+ //console.log(items);
this.form.innerHTML += template({items});
diff --git a/public/components/Feed/Feed.js b/public/components/Feed/Feed.js
index 9485056..1eb937d 100644
--- a/public/components/Feed/Feed.js
+++ b/public/components/Feed/Feed.js
@@ -54,7 +54,7 @@ export class Feed {
*
* @type {Response}
*/
- console.log(apiPath);
+ //console.log(apiPath);
const response = await fetch(`${endpoint}${apiPath}`, {
/**
* The HTTP method for the request.
@@ -70,6 +70,7 @@ export class Feed {
headers: {
//"Content-Type": "application/json",
},
+ credentials: "include",
});
if (response.ok) {
diff --git a/public/index.html b/public/index.html
index 71bdbec..d5ad8b6 100644
--- a/public/index.html
+++ b/public/index.html
@@ -16,6 +16,7 @@
+