diff --git a/front/src/pages/Orders.jsx b/front/src/pages/Orders.jsx index dffc089..e8baaf6 100644 --- a/front/src/pages/Orders.jsx +++ b/front/src/pages/Orders.jsx @@ -97,6 +97,7 @@ export default function Orders() { }) .catch((error) => { console.error('Error:', error); + alert('Не хватает билетов на сеанс') }); }; @@ -139,6 +140,27 @@ export default function Orders() { .catch(e => { console.log('Error get orders') }) } + async function handleDeleteOrderSession(id, sessionId) { + console.info('Start delete session'); + console.info(id+'-order, session-'+sessionId) + const requestParams = { + method: "PUT", + headers: { + "Content-Type": "application/json" + } + }; + const requestUrl = `http://localhost:8080/order/${id}?session=${sessionId}` + const response = await fetch(requestUrl, requestParams) + await response.json() + .then((data) => { + console.info('End delete session') + setOrderSessions(data.sessions) + }) + .catch((error) => { + console.error('Error:', error); + }); + } + const Content = ( <>