list events ok
This commit is contained in:
parent
52a0ec6284
commit
3f012c258f
@ -7,15 +7,17 @@ const parserConfig = {
|
|||||||
// mobilizon instance
|
// mobilizon instance
|
||||||
feeder_mobilizon_user_id: "3", // organizer_actor_id pour rattacher les nouveaux évènements à un utilisateur. 3 est le premier admin créé.
|
feeder_mobilizon_user_id: "3", // organizer_actor_id pour rattacher les nouveaux évènements à un utilisateur. 3 est le premier admin créé.
|
||||||
mobilizon_public_url: "https://mobilizon.openstreetmap.fr", // url publique de l'instance mobilizon pour créer les url d'évènements
|
mobilizon_public_url: "https://mobilizon.openstreetmap.fr", // url publique de l'instance mobilizon pour créer les url d'évènements
|
||||||
|
dev_url: "http://localhost:4000/api", // url publique de l'instance mobilizon pour créer les url d'évènements
|
||||||
// database of mobilizon
|
// database of mobilizon
|
||||||
db_name: "mobilizon_dev",
|
db_name: "mobilizon_dev",
|
||||||
db_user: "mobilizon",
|
db_user: "mobilizon",
|
||||||
db_pass: "0eHmz99Rb2WEhPKbwGJuAU-Da04jVV36QjuOOeJDOsK_Q1w7pikqIR04WqHoZLQi",
|
db_pass: "0eHmz99Rb2WEhPKbwGJuAU-Da04jVV36QjuOOeJDOsK_Q1w7pikqIR04WqHoZLQi",
|
||||||
// other configs
|
// other configs
|
||||||
askAgendaDuLibre: true, // should we fetch the Agenda du libre feed ?
|
askAgendaDuLibre: true, // should we fetch the Agenda du libre feed ?
|
||||||
askOsmCal: true,
|
askOsmCal: false,
|
||||||
runAddQueriesToMobilizonBDD: false,
|
runAddQueriesToMobilizonBDD: false,
|
||||||
debug: false,
|
debug: false,
|
||||||
|
organizerActorId: 3, // ID of the user who imports events in the mobilizon instance. 3 is the first admin user created, usually.
|
||||||
runAddQueriesToMobilizonAPI: true
|
runAddQueriesToMobilizonAPI: true
|
||||||
|
|
||||||
};
|
};
|
||||||
|
195
index.ts
195
index.ts
@ -2,7 +2,6 @@
|
|||||||
// imports
|
// imports
|
||||||
import utils from './utils';
|
import utils from './utils';
|
||||||
import parserConfig from './config';
|
import parserConfig from './config';
|
||||||
import { htmlEscape } from 'escape-goat';
|
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Parser from 'rss-parser';
|
import Parser from 'rss-parser';
|
||||||
@ -17,8 +16,8 @@ console.log(' ==== Rss Feeder for mobilizon - by tykayn ===='.blue);
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
console.log(' ==============================================='.blue);
|
console.log(' ==============================================='.blue);
|
||||||
if (parserConfig.debug) {
|
if (parserConfig.debug) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
console.log('configMobilizon'.blue, config);
|
console.log('configMobilizon'.blue, config);
|
||||||
}
|
}
|
||||||
const utilsTools = new utils();
|
const utilsTools = new utils();
|
||||||
|
|
||||||
@ -30,95 +29,127 @@ let counterOfEventsToAdd = 0;
|
|||||||
const addEventQuery = utilsTools.agendadulibre.addQuery;
|
const addEventQuery = utilsTools.agendadulibre.addQuery;
|
||||||
const runCreationQuery = utilsTools.runCreationQuery;
|
const runCreationQuery = utilsTools.runCreationQuery;
|
||||||
|
|
||||||
(async () => {
|
console.log('⌛ interroger la BDD mobilizon postgresql');
|
||||||
console.log('⌛ interroger la BDD mobilizon postgresql');
|
|
||||||
|
|
||||||
utilsTools.setupClientPostgresql();
|
async function init() {
|
||||||
|
|
||||||
await utilsTools.client.connect();
|
utilsTools.setupClientPostgresql();
|
||||||
console.log('✅ OK connecté à postgresql');
|
|
||||||
console.log(' ');
|
|
||||||
const res = await utilsTools.client.query('SELECT * from events');
|
|
||||||
console.log('💾 évènements enregistrés dans mobilizon : ', res.rows.length); // Hello world!
|
|
||||||
console.log('res', res);
|
|
||||||
utilsTools.localMobilizonEventsByTitle = res.rows;
|
|
||||||
|
|
||||||
if (parserConfig.askAgendaDuLibre) {
|
await utilsTools.client.connect();
|
||||||
// @ts-ignore
|
console.log('✅ OK connecté à postgresql');
|
||||||
console.log(' ===================================================='.blue);
|
console.log(' ');
|
||||||
// @ts-ignore
|
const res = await utilsTools.client.query('SELECT * from events');
|
||||||
console.log(' ==== demander à l\'agenda du libre son flux RSS ===='.blue);
|
console.log('💾 évènements enregistrés dans mobilizon : ', res.rows.length); // Hello world!
|
||||||
// @ts-ignore
|
// console.log('res', res);
|
||||||
console.log(' ===================================================='.blue);
|
utilsTools.localMobilizonEventsByTitle = res.rows;
|
||||||
|
|
||||||
console.log('⌛ lecture du flux rss : ' + parserConfig.rss_feed_url);
|
if (parserConfig.askAgendaDuLibre) {
|
||||||
fetch(parserConfig.rss_feed_url, { method: 'GET' })
|
// @ts-ignore
|
||||||
|
console.log(' ===================================================='.blue);
|
||||||
|
// @ts-ignore
|
||||||
|
console.log(' ==== demander à l\'agenda du libre son flux RSS ===='.blue);
|
||||||
|
// @ts-ignore
|
||||||
|
console.log(' ===================================================='.blue);
|
||||||
|
|
||||||
.then((arrayOfEvents:any) => {
|
console.log('⌛ lecture du flux rss : ' + parserConfig.rss_feed_url);
|
||||||
console.log('xml rss_feed_url count', Object.keys(arrayOfEvents).length);
|
fetch(parserConfig.rss_feed_url, {method: 'GET'})
|
||||||
|
|
||||||
});
|
.then((arrayOfEvents: any) => {
|
||||||
|
console.log('xml rss_feed_url count', Object.keys(arrayOfEvents).length);
|
||||||
|
|
||||||
let feed = await parser.parseURL(parserConfig.rss_feed_url);
|
});
|
||||||
console.log('✅ flux rss obtenu');
|
|
||||||
console.log(feed.title);
|
|
||||||
|
|
||||||
console.log('⚙️ interprétation des évènements');
|
let feed = await parser.parseURL(parserConfig.rss_feed_url);
|
||||||
console.log(
|
console.log('✅ flux rss obtenu');
|
||||||
'⌛ trouver les évènements qui ne font pas partie de la BDD mobilizon postgresql',
|
console.log(feed.title);
|
||||||
);
|
|
||||||
feed.items.forEach((eventFound) => {
|
|
||||||
console.log(eventFound.title);
|
|
||||||
// console.log('item', item)
|
|
||||||
utilsTools.agendadulibre.doesEventExists(eventFound);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (parserConfig.askOsmCal) {
|
|
||||||
// @ts-ignore
|
|
||||||
console.log(' ===================================================='.blue);
|
|
||||||
// @ts-ignore
|
|
||||||
console.log(' ==== demander à OSM cal ===='.blue);
|
|
||||||
// @ts-ignore
|
|
||||||
console.log(' ===================================================='.blue);
|
|
||||||
|
|
||||||
fetch(parserConfig.osmcal_url, { method: 'GET' })
|
console.log('⚙️ interprétation des évènements');
|
||||||
.then((res:any) => res.json())
|
console.log(
|
||||||
.then((arrayOfEvents:any) => {
|
'⌛ trouver les évènements qui ne font pas partie de la BDD mobilizon postgresql',
|
||||||
console.log('json osmcal count', arrayOfEvents.length);
|
);
|
||||||
|
feed.items.forEach((eventFound) => {
|
||||||
utilsTools.writeFile('osmcal.json', arrayOfEvents, 'json');
|
console.log(eventFound.title);
|
||||||
|
// console.log('item', item)
|
||||||
console.log('arrayOfEvents[0]', arrayOfEvents[1])
|
utilsTools.agendadulibre.doesEventExists(eventFound);
|
||||||
utilsTools.osmcal.doesEventExists(arrayOfEvents[1])
|
|
||||||
|
|
||||||
let EventsToCreate:any = [];
|
|
||||||
|
|
||||||
arrayOfEvents.forEach((eventFound:any) => {
|
|
||||||
if(!utilsTools.osmcal.doesEventExists(eventFound)){
|
|
||||||
EventsToCreate.push(eventFound);
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
utilsTools.createEventQueriesForApi(EventsToCreate)
|
}
|
||||||
|
if (parserConfig.askOsmCal) {
|
||||||
|
// @ts-ignore
|
||||||
|
console.log(' ===================================================='.blue);
|
||||||
|
// @ts-ignore
|
||||||
|
console.log(' ==== demander à OSM cal ===='.blue);
|
||||||
|
// @ts-ignore
|
||||||
|
console.log(' ===================================================='.blue);
|
||||||
|
|
||||||
});
|
fetch(parserConfig.osmcal_url, {method: 'GET'})
|
||||||
}
|
.then((res: any) => res.json())
|
||||||
|
.then((arrayOfEvents: any) => {
|
||||||
|
console.log('json osmcal count', arrayOfEvents.length);
|
||||||
|
|
||||||
if (parserConfig.runAddQueriesToMobilizonAPI) {
|
// utilsTools.writeFile('osmcal.json', arrayOfEvents, 'json');
|
||||||
console.log(
|
|
||||||
'➕ rajouter les évènements manquants par l\'API GraphQL',
|
let EventsToCreate: any = [];
|
||||||
);
|
|
||||||
|
arrayOfEvents.forEach((eventFound: any) => {
|
||||||
|
if (!utilsTools.osmcal.doesEventExists(eventFound)) {
|
||||||
|
EventsToCreate.push(eventFound);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
});
|
||||||
|
utilsTools.createEventQueriesForApi(EventsToCreate)
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parserConfig.runAddQueriesToMobilizonAPI) {
|
||||||
|
console.log(
|
||||||
|
'➕ rajouter les évènements manquants par l\'API GraphQL',
|
||||||
|
utilsTools.agendadulibre.queryToAdd.length
|
||||||
|
);
|
||||||
|
let limiter = true;
|
||||||
|
let counter = 0;
|
||||||
|
|
||||||
|
utilsTools.agendadulibre.queryToAdd.forEach((graphQLquery: any) => {
|
||||||
|
|
||||||
|
|
||||||
}
|
if (limiter && !counter) {
|
||||||
if (parserConfig.runAddQueriesToMobilizonBDD) {
|
counter++;
|
||||||
// @ts-ignore
|
console.log('graphQLquery.variables.title', graphQLquery.variables.title);
|
||||||
console.log(
|
|
||||||
'➕ rajouter les évènements manquants à la base mobilizon',
|
|
||||||
);
|
|
||||||
|
|
||||||
utilsTools.makeQuery();
|
const body = {
|
||||||
utilsTools.runCreationQuery();
|
operationName: "createEvent",
|
||||||
// @ts-ignore
|
query: graphQLquery.query,
|
||||||
|
variables: graphQLquery.variables
|
||||||
|
}
|
||||||
|
// fetch(parserConfig.dev_url, {
|
||||||
|
// method: "post",
|
||||||
|
// body: JSON.stringify(body),
|
||||||
|
// headers: {"Content-Type": "application/json"}
|
||||||
|
// })
|
||||||
|
// .then(res => {
|
||||||
|
// res.json()
|
||||||
|
// console.log('succès');
|
||||||
|
// })
|
||||||
|
// .then(json => console.log(json))
|
||||||
|
// .catch(err => console.log(err))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parserConfig.runAddQueriesToMobilizonBDD) {
|
||||||
|
// @ts-ignore
|
||||||
|
console.log(
|
||||||
|
'➕ rajouter les évènements manquants à la base mobilizon',
|
||||||
|
);
|
||||||
|
|
||||||
|
utilsTools.makeQuery();
|
||||||
|
utilsTools.runCreationQuery();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
// @ts-ignore
|
||||||
console.log(' ---------- '.green);
|
console.log(' ---------- '.green);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
console.log(counterOfEventsToAdd, ' évènements ajoutés '.green);
|
console.log(counterOfEventsToAdd, ' évènements ajoutés '.green);
|
||||||
@ -126,10 +157,10 @@ const runCreationQuery = utilsTools.runCreationQuery;
|
|||||||
console.log(' ---------- '.green);
|
console.log(' ---------- '.green);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
console.log('✅ fermer la connec postgresql');
|
console.log('✅ fermer la connec postgresql');
|
||||||
await utilsTools.client.end();
|
utilsTools.client.end();
|
||||||
console.log('✅ ça c\'est fait ');
|
console.log('✅ ça c\'est fait ');
|
||||||
}
|
console.log(' ');
|
||||||
|
}
|
||||||
|
|
||||||
})();
|
(init)();
|
||||||
|
console.log('✅ hey ho', this);
|
||||||
console.log('✅ hey ho', this);
|
|
||||||
|
File diff suppressed because one or more lines are too long
87
utils.ts
87
utils.ts
@ -13,11 +13,14 @@ class utils {
|
|||||||
/**
|
/**
|
||||||
* postgres functions
|
* postgres functions
|
||||||
*/
|
*/
|
||||||
client:any;
|
client: any;
|
||||||
makeQuery = () => {
|
makeQuery = () => {
|
||||||
this.createEventQueries = `INSERT INTO events(title, description, organizer_actor_id, inserted_at, updated_at,
|
this.createEventQueries = `INSERT INTO events(title, description, organizer_actor_id, inserted_at, updated_at,
|
||||||
uuid, url, status, category, options, participants_stats,
|
uuid, url, status, category, options, participants_stats,
|
||||||
begins_on, ends_on) VALUES ${this.agendadulibre.queryToAdd} ${this.osmcal.queryToAdd};`;
|
begins_on, ends_on)
|
||||||
|
VALUES
|
||||||
|
${this.agendadulibre.queryToAdd}
|
||||||
|
${this.osmcal.queryToAdd};`;
|
||||||
this.writeFile("event_creation_query.psql", this.createEventQueries, "psql");
|
this.writeFile("event_creation_query.psql", this.createEventQueries, "psql");
|
||||||
}
|
}
|
||||||
runCreationQuery = async () => {
|
runCreationQuery = async () => {
|
||||||
@ -41,7 +44,7 @@ class utils {
|
|||||||
*/
|
*/
|
||||||
createEventQueries = "";
|
createEventQueries = "";
|
||||||
counterOfEventsToAdd = 0;
|
counterOfEventsToAdd = 0;
|
||||||
localMobilizonEventsByTitle : Array<string> = [];
|
localMobilizonEventsByTitle: Array<string> = [];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,10 +53,11 @@ class utils {
|
|||||||
|
|
||||||
geocoderNominatim(coords: any) {
|
geocoderNominatim(coords: any) {
|
||||||
// https://nominatim.openstreetmap.org/reverse?lat=<value>&lon=<value>&<params>
|
// https://nominatim.openstreetmap.org/reverse?lat=<value>&lon=<value>&<params>
|
||||||
|
|
||||||
console.log('https://nominatim.openstreetmap.org/reverse?lat=' + coords[0] + '&lon=' + coords[0]) + '&format=json'
|
console.log('https://nominatim.openstreetmap.org/reverse?lat=' + coords[0] + '&lon=' + coords[0]) + '&format=json'
|
||||||
}
|
}
|
||||||
|
|
||||||
convertRssDate(rssDate: any) {
|
convertRssDateBDD(rssDate: any) {
|
||||||
let converted = moment(rssDate)
|
let converted = moment(rssDate)
|
||||||
.format("YYYY-MM-DD LTS")
|
.format("YYYY-MM-DD LTS")
|
||||||
.slice(0, -3)
|
.slice(0, -3)
|
||||||
@ -64,6 +68,20 @@ class utils {
|
|||||||
return converted;
|
return converted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
convertRssDate(rssDate: string): string {
|
||||||
|
console.log('rssDate', rssDate);
|
||||||
|
if (rssDate) {
|
||||||
|
|
||||||
|
let converted = new Date(rssDate).toISOString(); // in js format like 2021-03-12T19:00:00Z
|
||||||
|
|
||||||
|
console.log("converted", converted);
|
||||||
|
// like 2021-01-03 15:31:02.918940
|
||||||
|
return converted;
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
convertCoordinateLinkOsmCal(coords: any) {
|
convertCoordinateLinkOsmCal(coords: any) {
|
||||||
|
|
||||||
|
|
||||||
@ -77,7 +95,6 @@ class utils {
|
|||||||
|
|
||||||
testdateconvert() {
|
testdateconvert() {
|
||||||
let converted = this.convertRssDate("2021-03-12T19:00:00Z");
|
let converted = this.convertRssDate("2021-03-12T19:00:00Z");
|
||||||
console.log("converted", converted);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,7 +110,7 @@ class utils {
|
|||||||
`./sources_examples/${fileName}`,
|
`./sources_examples/${fileName}`,
|
||||||
dataToSave,
|
dataToSave,
|
||||||
"utf8",
|
"utf8",
|
||||||
(err:any) => {
|
(err: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(`Error writing file: ${err}`);
|
console.log(`Error writing file: ${err}`);
|
||||||
} else {
|
} else {
|
||||||
@ -114,7 +131,7 @@ class utils {
|
|||||||
return event.name;
|
return event.name;
|
||||||
//+ ' '+ event.location.short
|
//+ ' '+ event.location.short
|
||||||
},
|
},
|
||||||
doesEventExists: (event: any) : boolean => {
|
doesEventExists: (event: any): boolean => {
|
||||||
const eventAlreadyExists =
|
const eventAlreadyExists =
|
||||||
-1 !== this.localMobilizonEventsByTitle.indexOf(this.osmcal.getTitle(event));
|
-1 !== this.localMobilizonEventsByTitle.indexOf(this.osmcal.getTitle(event));
|
||||||
if (!eventAlreadyExists) {
|
if (!eventAlreadyExists) {
|
||||||
@ -168,8 +185,9 @@ class utils {
|
|||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
agendadulibre = {
|
agendadulibre:any = {
|
||||||
queryToAdd: "",
|
queryToAdd: [],
|
||||||
|
queryToAddBDD: "",
|
||||||
counterOfEventsToAdd: 0,
|
counterOfEventsToAdd: 0,
|
||||||
doesEventExists: (event: any) => {
|
doesEventExists: (event: any) => {
|
||||||
if (this.localMobilizonEventsByTitle.length) {
|
if (this.localMobilizonEventsByTitle.length) {
|
||||||
@ -182,10 +200,57 @@ class utils {
|
|||||||
this.agendadulibre.addQuery(event);
|
this.agendadulibre.addQuery(event);
|
||||||
}
|
}
|
||||||
return eventAlreadyExists;
|
return eventAlreadyExists;
|
||||||
|
} else {
|
||||||
|
console.log('aucun évènement dans localMobilizonEventsByTitle');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
addQuery: (event: any) => {
|
addQuery: (event: any) => {
|
||||||
|
this.agendadulibre.queryToAdd.push(
|
||||||
|
{
|
||||||
|
operationName: "createEvent",
|
||||||
|
query: "mutation createEvent($organizerActorId: ID!, $attributedToId: ID, $title: String!, $description: String!, $beginsOn: DateTime!, $endsOn: DateTime, $status: EventStatus, $visibility: EventVisibility, $joinOptions: EventJoinOptions, $draft: Boolean, $tags: [String], $picture: MediaInput, $onlineAddress: String, $phoneAddress: String, $category: String, $physicalAddress: AddressInput, $options: EventOptionsInput, $contacts: [Contact]) {\n createEvent(\n organizerActorId: $organizerActorId\n attributedToId: $attributedToId\n title: $title\n description: $description\n beginsOn: $beginsOn\n endsOn: $endsOn\n status: $status\n visibility: $visibility\n joinOptions: $joinOptions\n draft: $draft\n tags: $tags\n picture: $picture\n onlineAddress: $onlineAddress\n phoneAddress: $phoneAddress\n category: $category\n physicalAddress: $physicalAddress\n options: $options\n contacts: $contacts\n ) {\n ...FullEvent\n __typename\n }\n}\n\nfragment FullEvent on Event {\n id\n uuid\n url\n local\n title\n description\n beginsOn\n endsOn\n status\n visibility\n joinOptions\n draft\n picture {\n id\n url\n name\n metadata {\n width\n height\n blurhash\n __typename\n }\n __typename\n }\n publishAt\n onlineAddress\n phoneAddress\n physicalAddress {\n ...AdressFragment\n __typename\n }\n organizerActor {\n avatar {\n id\n url\n __typename\n }\n preferredUsername\n domain\n name\n url\n id\n summary\n __typename\n }\n contacts {\n avatar {\n id\n url\n __typename\n }\n preferredUsername\n name\n summary\n domain\n url\n id\n __typename\n }\n attributedTo {\n avatar {\n id\n url\n __typename\n }\n preferredUsername\n name\n summary\n domain\n url\n id\n __typename\n }\n participantStats {\n going\n notApproved\n participant\n __typename\n }\n tags {\n ...TagFragment\n __typename\n }\n relatedEvents {\n id\n uuid\n title\n beginsOn\n picture {\n id\n url\n name\n metadata {\n width\n height\n blurhash\n __typename\n }\n __typename\n }\n physicalAddress {\n id\n description\n __typename\n }\n organizerActor {\n id\n avatar {\n id\n url\n __typename\n }\n preferredUsername\n domain\n name\n __typename\n }\n __typename\n }\n options {\n ...EventOptions\n __typename\n }\n metadata {\n key\n title\n value\n type\n __typename\n }\n __typename\n}\n\nfragment AdressFragment on Address {\n id\n description\n geom\n street\n locality\n postalCode\n region\n country\n type\n url\n originId\n __typename\n}\n\nfragment TagFragment on Tag {\n id\n slug\n title\n __typename\n}\n\nfragment EventOptions on EventOptions {\n maximumAttendeeCapacity\n remainingAttendeeCapacity\n showRemainingAttendeeCapacity\n anonymousParticipation\n showStartTime\n showEndTime\n offers {\n price\n priceCurrency\n url\n __typename\n }\n participationConditions {\n title\n content\n url\n __typename\n }\n attendees\n program\n commentModeration\n showParticipationPrice\n hideOrganizerWhenGroupEvent\n __typename\n}\n",
|
||||||
|
variables: {
|
||||||
|
attributedToId: null,
|
||||||
|
beginsOn: event.date_start,
|
||||||
|
contacts: [],
|
||||||
|
description: "<p>"+event.content+"</p>",
|
||||||
|
draft: false,
|
||||||
|
endsOn: event.date_end,
|
||||||
|
joinOptions: "FREE",
|
||||||
|
onlineAddress: "https://cipherbliss.com",
|
||||||
|
options: {
|
||||||
|
anonymousParticipation: true,
|
||||||
|
attendees: [],
|
||||||
|
commentModeration: "ALLOW_ALL",
|
||||||
|
hideOrganizerWhenGroupEvent: false,
|
||||||
|
maximumAttendeeCapacity: 200,
|
||||||
|
offers: [],
|
||||||
|
participationConditions: [],
|
||||||
|
program: "",
|
||||||
|
remainingAttendeeCapacity: 0,
|
||||||
|
showEndTime: true,
|
||||||
|
showParticipationPrice: false,
|
||||||
|
showRemainingAttendeeCapacity: false,
|
||||||
|
showStartTime: true
|
||||||
|
},
|
||||||
|
organizerActorId: "3",
|
||||||
|
phoneAddress: "",
|
||||||
|
status: "CONFIRMED",
|
||||||
|
tags: [
|
||||||
|
"osm",
|
||||||
|
"openstreetmap",
|
||||||
|
"imported"
|
||||||
|
],
|
||||||
|
title: event.title,
|
||||||
|
visibility: "PUBLIC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return this.agendadulibre.queryToAdd;
|
||||||
|
},
|
||||||
|
addQueryBDD: (event: any) => {
|
||||||
if (this.agendadulibre.queryToAdd) {
|
if (this.agendadulibre.queryToAdd) {
|
||||||
this.agendadulibre.queryToAdd += ` , `;
|
this.agendadulibre.queryToAdd += ` , `;
|
||||||
}
|
}
|
||||||
@ -221,9 +286,9 @@ class utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createEventQueriesForApi(EventsToCreate: any[]) {
|
createEventQueriesForApi(EventsToCreate: any[]) {
|
||||||
if(EventsToCreate.length){
|
if (EventsToCreate.length) {
|
||||||
console.log('we will create events', EventsToCreate.length);
|
console.log('we will create events', EventsToCreate.length);
|
||||||
}else{
|
} else {
|
||||||
console.log('no events to create');
|
console.log('no events to create');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user