Compare commits

...

2 Commits

Author SHA1 Message Date
Ryan Mwangi 5a00247eef Function to add a new link to a link group 2024-10-12 01:09:05 +03:00
Ryan Mwangi 77136f1a14 Function to add a new link group 2024-10-12 01:08:32 +03:00
1 changed files with 27 additions and 0 deletions

View File

@ -103,6 +103,33 @@ app.get('/:filename', (req, res) => {
// Store the merged calendar URL in a file
const mergedCalendarUrlFile = 'merged_calendar_url.txt';
//calendarData object to store calendar data
let calendarData = {
linkGroups: []
};
// Function to add a new link group
function addLinkGroup(name) {
const newLinkGroup = {
name,
links: []
};
calendarData.linkGroups.push(newLinkGroup);
return newLinkGroup;
}
// Function to add a new link to a link group
function addLinkToGroup(linkGroup, url, prefix, overrideSummary) {
const newLink = {
url,
prefix,
overrideSummary
};
linkGroup.links.push(newLink);
return newLink;
}
// Function to update the merged calendar
async function updateMergedCalendar(){
try {