academicYear logic

This commit is contained in:
amNobodyyy
2025-01-27 23:34:51 +05:30
parent 805d866190
commit 4466b33dff
9 changed files with 138 additions and 88 deletions

View File

@@ -78,6 +78,18 @@ export const fetchOptions = async () => {
}
};
export const fetchAppointments = async (academicYear) => {
try {
const response = await fetch(`${BASE_URL}/appointments?academicYear=${academicYear}`);
if (!response.ok) {
throw new Error("Failed to fetch appointments");
}
return await response.json();
} catch (error) {
console.error(error);
return [];
}
};
// Save multiple appointments to MongoDB
export const saveAppointment = async (appointmentsData) => {