mirror of
https://github.com/FliegendeWurst/telegram_notes_bot.git
synced 2024-11-25 12:04:58 +00:00
16 lines
412 B
JavaScript
16 lines
412 B
JavaScript
const {req, res} = api;
|
|
|
|
const targetTemplate = await api.currentNote.getRelationValue("targetTemplateEvent");
|
|
const events = await api.getNotesWithLabel("template", targetTemplate);
|
|
|
|
let eventsData = [];
|
|
|
|
for (const event of events) {
|
|
const attr = await event.getAttribute("label", "startTime");
|
|
eventsData.push({
|
|
name: event.title,
|
|
startTime: attr.value
|
|
});
|
|
}
|
|
|
|
res.send(eventsData); |