update mapado event working
This commit is contained in:
parent
4cd3bfba57
commit
c98d5eb36b
8 changed files with 184 additions and 126 deletions
|
|
@ -4,7 +4,9 @@
|
|||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.collapsable > * {
|
||||
.collapsable:not(:first-child) > *,
|
||||
.collapsable:first-child > button,
|
||||
.collapsable .session {
|
||||
padding: var(--row-padding);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
|
|
@ -34,6 +36,12 @@
|
|||
.collapsable__content {
|
||||
font-size: var(--font-size-s);
|
||||
}
|
||||
|
||||
.collapsable__content .session {
|
||||
font-size: var(--font-size-m);
|
||||
grid-template-columns: 2fr 1fr 1fr 1fr;
|
||||
}
|
||||
|
||||
.collapsable__content .production p:not(:last-child) {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,33 @@ function getDatesInMonth(month) {
|
|||
return dates;
|
||||
}
|
||||
|
||||
async function getMapadoEvent(id) {
|
||||
const requestEndPoint = "ticketings/" + id;
|
||||
|
||||
const requestParams = [];
|
||||
|
||||
const requestFields = [
|
||||
{ name: "startDate" },
|
||||
{ name: "bookableStock" },
|
||||
{
|
||||
name: "eventDateList",
|
||||
subfields: [{ name: "@id" }, { name: "bookableStock" }],
|
||||
},
|
||||
];
|
||||
|
||||
const requestOptions = {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ requestEndPoint, requestParams, requestFields }),
|
||||
};
|
||||
|
||||
const response = await fetch("/mapado-api.json", requestOptions);
|
||||
const json = await response.json();
|
||||
|
||||
const event = json["hydra:member"];
|
||||
|
||||
console.log(`Événement Mapado`, event);
|
||||
}
|
||||
|
||||
async function getMapadoDates(monthNumb) {
|
||||
const contractId = "1941";
|
||||
|
||||
|
|
@ -129,3 +156,20 @@ async function getMergedDates(monthNumb, dates) {
|
|||
const json = await response.json();
|
||||
return json;
|
||||
}
|
||||
|
||||
async function updateMapadoEvent(pageUri) {
|
||||
const headers = new Headers();
|
||||
|
||||
const requestOptions = {
|
||||
method: "POST",
|
||||
headers: headers,
|
||||
redirect: "follow",
|
||||
body: JSON.stringify({
|
||||
pageUri,
|
||||
}),
|
||||
};
|
||||
|
||||
const response = await fetch("/update-mapado-event.json", requestOptions);
|
||||
const json = await response.json();
|
||||
return json;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue