placeholder for calendar backend

This commit is contained in:
2025-10-17 11:21:43 -04:00
parent 9701ed5b03
commit f7a0884fb3
2 changed files with 54 additions and 0 deletions

33
api/routes/calendar.js Normal file
View File

@@ -0,0 +1,33 @@
const express = require('express');
const r = express.Router();
const ur = express.Router();
const pool = require('../db');
//insert a new latest rank for a user
ur.post('/', async (req, res) => {3
try {
const change = req.body?.change;
console.log(change);
await insertMemberRank(change);
res.sendStatus(201);
} catch (err) {
console.error('Insert failed:', err);
res.status(500).json({ error: 'Failed to update ranks' });
}
});
//get all ranks
r.get('/', async (req, res) => {
try {
const ranks = await getAllRanks();
console.log(ranks);
res.json(ranks);
} catch (err) {
console.error(err);
res.status(500).json({ error: 'Internal server error' });
}
});
module.exports.ranks = r;
module.exports.memberRanks = ur;

View File

@@ -0,0 +1,21 @@
const pool = require('../db')
export async function createEvent(eventObject) {
}
export async function updateEvent(eventObject) {
}
export async function cancelEvent(eventID) {
}
export async function getShortEventsInRange(startDate, endDate) {
}
export async function getEventDetailed(eventID) {
}